improve documentation plugin-transcode
- add example of videoFilters - add warning about videoFilters and inputOptions in live profile
This commit is contained in:
parent
43f7a43ca4
commit
d5fc35c24d
1 changed files with 11 additions and 0 deletions
|
@ -328,6 +328,8 @@ function register (...) {
|
||||||
Adding transcoding profiles allow admins to change ffmpeg encoding parameters and/or encoders.
|
Adding transcoding profiles allow admins to change ffmpeg encoding parameters and/or encoders.
|
||||||
A transcoding profile has to be chosen by the admin of the instance using the admin configuration.
|
A transcoding profile has to be chosen by the admin of the instance using the admin configuration.
|
||||||
|
|
||||||
|
Transcoding profiles used for live transcoding must not provide any `videoFilters`.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
async function register ({
|
async function register ({
|
||||||
transcodingManager
|
transcodingManager
|
||||||
|
@ -341,8 +343,12 @@ async function register ({
|
||||||
const streamString = streamNum ? ':' + streamNum : ''
|
const streamString = streamNum ? ':' + streamNum : ''
|
||||||
|
|
||||||
// You can also return a promise
|
// You can also return a promise
|
||||||
|
// All these options are optional and defaults to []
|
||||||
return {
|
return {
|
||||||
inputOptions: [],
|
inputOptions: [],
|
||||||
|
videoFilters: [
|
||||||
|
'vflip' // flip the video vertically
|
||||||
|
],
|
||||||
outputOptions: [
|
outputOptions: [
|
||||||
// Use a custom bitrate
|
// Use a custom bitrate
|
||||||
'-b' + streamString + ' 10K'
|
'-b' + streamString + ' 10K'
|
||||||
|
@ -358,6 +364,7 @@ async function register ({
|
||||||
|
|
||||||
// And/Or support this profile for live transcoding
|
// And/Or support this profile for live transcoding
|
||||||
transcodingManager.addLiveProfile(encoder, profileName, builder)
|
transcodingManager.addLiveProfile(encoder, profileName, builder)
|
||||||
|
// Note: this profile will fail for live transcode because it specifies videoFilters
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -394,6 +401,7 @@ async function register ({
|
||||||
const builder = () => {
|
const builder = () => {
|
||||||
return {
|
return {
|
||||||
inputOptions: [],
|
inputOptions: [],
|
||||||
|
videoFilters: [],
|
||||||
outputOptions: []
|
outputOptions: []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -413,6 +421,9 @@ async function register ({
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
During live transcode input options are applied once for each target resolution.
|
||||||
|
Plugins are responsible for detecting such situation and applying input options only once if necessary.
|
||||||
|
|
||||||
### Helpers
|
### Helpers
|
||||||
|
|
||||||
PeerTube provides your plugin some helpers. For example:
|
PeerTube provides your plugin some helpers. For example:
|
||||||
|
|
Loading…
Reference in a new issue