diff options
author | Théo Le Calvar <tlc@kher.nl> | 2021-04-06 11:00:33 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-04-09 15:53:18 +0200 |
commit | d5fc35c24d496b097dbe222db53355cc339d8606 (patch) | |
tree | 8ca14ea9f544ca8a96b7ae9d0c1f8307354bc174 /support/doc/plugins | |
parent | 43f7a43ca442de0c838cb15c55ab8845f3eec950 (diff) | |
download | PeerTube-d5fc35c24d496b097dbe222db53355cc339d8606.tar.gz PeerTube-d5fc35c24d496b097dbe222db53355cc339d8606.tar.zst PeerTube-d5fc35c24d496b097dbe222db53355cc339d8606.zip |
improve documentation plugin-transcode
- add example of videoFilters
- add warning about videoFilters and inputOptions in live profile
Diffstat (limited to 'support/doc/plugins')
-rw-r--r-- | support/doc/plugins/guide.md | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/support/doc/plugins/guide.md b/support/doc/plugins/guide.md index 18e962c10..331813e4f 100644 --- a/support/doc/plugins/guide.md +++ b/support/doc/plugins/guide.md | |||
@@ -328,6 +328,8 @@ function register (...) { | |||
328 | Adding transcoding profiles allow admins to change ffmpeg encoding parameters and/or encoders. | 328 | Adding transcoding profiles allow admins to change ffmpeg encoding parameters and/or encoders. |
329 | A transcoding profile has to be chosen by the admin of the instance using the admin configuration. | 329 | A transcoding profile has to be chosen by the admin of the instance using the admin configuration. |
330 | 330 | ||
331 | Transcoding profiles used for live transcoding must not provide any `videoFilters`. | ||
332 | |||
331 | ```js | 333 | ```js |
332 | async function register ({ | 334 | async function register ({ |
333 | transcodingManager | 335 | transcodingManager |
@@ -341,8 +343,12 @@ async function register ({ | |||
341 | const streamString = streamNum ? ':' + streamNum : '' | 343 | const streamString = streamNum ? ':' + streamNum : '' |
342 | 344 | ||
343 | // You can also return a promise | 345 | // You can also return a promise |
346 | // All these options are optional and defaults to [] | ||
344 | return { | 347 | return { |
345 | inputOptions: [], | 348 | inputOptions: [], |
349 | videoFilters: [ | ||
350 | 'vflip' // flip the video vertically | ||
351 | ], | ||
346 | outputOptions: [ | 352 | outputOptions: [ |
347 | // Use a custom bitrate | 353 | // Use a custom bitrate |
348 | '-b' + streamString + ' 10K' | 354 | '-b' + streamString + ' 10K' |
@@ -358,6 +364,7 @@ async function register ({ | |||
358 | 364 | ||
359 | // And/Or support this profile for live transcoding | 365 | // And/Or support this profile for live transcoding |
360 | transcodingManager.addLiveProfile(encoder, profileName, builder) | 366 | transcodingManager.addLiveProfile(encoder, profileName, builder) |
367 | // Note: this profile will fail for live transcode because it specifies videoFilters | ||
361 | } | 368 | } |
362 | 369 | ||
363 | { | 370 | { |
@@ -394,6 +401,7 @@ async function register ({ | |||
394 | const builder = () => { | 401 | const builder = () => { |
395 | return { | 402 | return { |
396 | inputOptions: [], | 403 | inputOptions: [], |
404 | videoFilters: [], | ||
397 | outputOptions: [] | 405 | outputOptions: [] |
398 | } | 406 | } |
399 | } | 407 | } |
@@ -413,6 +421,9 @@ async function register ({ | |||
413 | } | 421 | } |
414 | ``` | 422 | ``` |
415 | 423 | ||
424 | During live transcode input options are applied once for each target resolution. | ||
425 | Plugins are responsible for detecting such situation and applying input options only once if necessary. | ||
426 | |||
416 | ### Helpers | 427 | ### Helpers |
417 | 428 | ||
418 | PeerTube provides your plugin some helpers. For example: | 429 | PeerTube provides your plugin some helpers. For example: |