Verified Commit efffdc45 authored by Chocobozzz's avatar Chocobozzz
Browse files

Add scale filter to documentation

parent 34fd3f2f
......@@ -396,8 +396,8 @@ async function buildx264VODCommand (command: ffmpeg.FfmpegCommand, options: Tran
if (options.resolution !== undefined) {
scaleFilterValue = options.isPortraitMode === true
? `${options.resolution}:-2`
: `-2:${options.resolution}`
? `w=${options.resolution}:h=-2`
: `w=-2:h=${options.resolution}`
}
command = await presetVideo({ command, input: options.inputPath, transcodeOptions: options, fps, scaleFilterValue })
......
......@@ -24,10 +24,9 @@ import { VIDEO_TRANSCODING_FPS } from '../initializers/constants'
const defaultX264VODOptionsBuilder: EncoderOptionsBuilder = async ({ input, resolution, fps }) => {
const targetBitrate = await buildTargetBitrate({ input, resolution, fps })
if (!targetBitrate) return { inputOptions: [ ], outputOptions: [ ] }
if (!targetBitrate) return { outputOptions: [ ] }
return {
inputOptions: [ ],
outputOptions: [
`-preset veryfast`,
`-r ${fps}`,
......@@ -41,7 +40,6 @@ const defaultX264LiveOptionsBuilder: EncoderOptionsBuilder = async ({ resolution
const targetBitrate = getTargetBitrate(resolution, fps, VIDEO_TRANSCODING_FPS)
return {
inputOptions: [ ],
outputOptions: [
`-preset veryfast`,
`${buildStreamSuffix('-r:v', streamNum)} ${fps}`,
......@@ -57,7 +55,7 @@ const defaultAACOptionsBuilder: EncoderOptionsBuilder = async ({ input, streamNu
if (await canDoQuickAudioTranscode(input, probe)) {
logger.debug('Copy audio stream %s by AAC encoder.', input)
return { copy: true, inputOptions: [ ], outputOptions: [ ] }
return { copy: true, outputOptions: [ ] }
}
const parsedAudio = await getAudioStream(input, probe)
......@@ -72,14 +70,14 @@ const defaultAACOptionsBuilder: EncoderOptionsBuilder = async ({ input, streamNu
logger.debug('Calculating audio bitrate of %s by AAC encoder.', input, { bitrate: parsedAudio.bitrate, audioCodecName })
if (bitrate !== undefined && bitrate !== -1) {
return { inputOptions: [ ], outputOptions: [ buildStreamSuffix('-b:a', streamNum), bitrate + 'k' ] }
return { outputOptions: [ buildStreamSuffix('-b:a', streamNum), bitrate + 'k' ] }
}
return { inputOptions: [ ], outputOptions: [ ] }
return { outputOptions: [ ] }
}
const defaultLibFDKAACVODOptionsBuilder: EncoderOptionsBuilder = ({ streamNum }) => {
return { inputOptions: [ ], outputOptions: [ buildStreamSuffix('-q:a', streamNum), '5' ] }
return { outputOptions: [ buildStreamSuffix('-q:a', streamNum), '5' ] }
}
// Used to get and update available encoders
......
......@@ -19,7 +19,6 @@ import {
uninstallPlugin,
updateCustomSubConfig,
uploadVideoAndGetId,
waitFfmpegUntilError,
waitJobs,
waitUntilLivePublished
} from '../../../shared/extra-utils'
......
......@@ -341,9 +341,16 @@ async function register ({
const streamString = streamNum ? ':' + streamNum : ''
// You can also return a promise
// All these options are optional and defaults to []
// All these options are optional
return {
scaleFilter: {
// Used to define an alternative scale filter, needed by some encoders
// Default to 'scale'
name: 'scale_vaapi'
},
// Default to []
inputOptions: [],
// Default to []
outputOptions: [
// Use a custom bitrate
'-b' + streamString + ' 10K'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment