Contents
On this page
Update Encoding Settings - Plugixa Stream
PUT /plugixa-stream/v1/admin/transcode/settings
Save the encoding settings. Fields you leave out keep their value.
Needs a user with the plugixa_stream_manage_settings capability (signed in with an Application Password or the login cookie). Administrators hold it; other roles only when you grant it. Only a site administrator (manage_options) can change ffmpeg_path: a path names a program the server runs.
Request
PUT https://your-site.example/wp-json/plugixa-stream/v1/admin/transcode/settings
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
heights |
integer[] |
No | From 2160, 1440, 1080, 720, 480, 360. Others are dropped; none left means 1080, 720 and 480. |
preset |
string |
No | ultrafast to slow. Anything else reads as veryfast. |
auto |
boolean |
No | Encode new uploads automatically. |
max_jobs |
integer |
No | 1 to 4. |
ffmpeg_path |
string |
No | Administrators only; ignored for others. |
{
"heights": [1080, 720, 480],
"preset": "veryfast",
"auto": true
}
Responses
200 OK. The settings as in Get Encoding Settings.
{
"success": true,
"data": {
"ffmpeg_path": "",
"heights": [1080, 720, 480],
"preset": "veryfast",
"auto": true,
"max_jobs": 1,
"heights_all": [2160, 1440, 1080, 720, 480, 360],
"presets": ["ultrafast", "superfast", "veryfast", "faster", "fast", "medium", "slow"],
"can_paths": true,
"ffmpeg": {
"available": true,
"can_spawn": true,
"version": "6.1.1",
"path": "/usr/bin/ffmpeg"
}
}
}
Errors
| Status | Code | When |
|---|---|---|
401 / 403 |
plugixa_stream_forbidden |
The caller lacks the capability. |
Plus the errors every endpoint can return.
Examples
curl -s -X PUT "https://your-site.example/wp-json/plugixa-stream/v1/admin/transcode/settings" \
-u "$WP_USER:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"heights":[1080,720,480],"preset":"veryfast","auto":true}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-stream/v1/admin/transcode/settings');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => getenv('WP_USER') . ':' . getenv('WP_APP_PASSWORD'),
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'heights' => [1080, 720, 480],
'preset' => 'veryfast',
'auto' => true,
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-stream/v1/admin/transcode/settings', {
method: 'PUT',
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ heights: [1080, 720, 480], preset: 'veryfast', auto: true }),
});
const { data } = await response.json();
Quick Links
Share