1
0
Fork 0

Add scale filter to documentation

This commit is contained in:
Chocobozzz 2021-04-09 15:31:09 +02:00 committed by Chocobozzz
parent 3e03b961b8
commit a60696ab18
4 changed files with 15 additions and 11 deletions

View file

@ -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 })

View file

@ -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

View file

@ -19,7 +19,6 @@ import {
uninstallPlugin,
updateCustomSubConfig,
uploadVideoAndGetId,
waitFfmpegUntilError,
waitJobs,
waitUntilLivePublished
} from '../../../shared/extra-utils'

View file

@ -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'