Add scale filter to documentation
This commit is contained in:
parent
3e03b961b8
commit
a60696ab18
|
@ -396,8 +396,8 @@ async function buildx264VODCommand (command: ffmpeg.FfmpegCommand, options: Tran
|
||||||
|
|
||||||
if (options.resolution !== undefined) {
|
if (options.resolution !== undefined) {
|
||||||
scaleFilterValue = options.isPortraitMode === true
|
scaleFilterValue = options.isPortraitMode === true
|
||||||
? `${options.resolution}:-2`
|
? `w=${options.resolution}:h=-2`
|
||||||
: `-2:${options.resolution}`
|
: `w=-2:h=${options.resolution}`
|
||||||
}
|
}
|
||||||
|
|
||||||
command = await presetVideo({ command, input: options.inputPath, transcodeOptions: options, fps, scaleFilterValue })
|
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 defaultX264VODOptionsBuilder: EncoderOptionsBuilder = async ({ input, resolution, fps }) => {
|
||||||
const targetBitrate = await buildTargetBitrate({ input, resolution, fps })
|
const targetBitrate = await buildTargetBitrate({ input, resolution, fps })
|
||||||
if (!targetBitrate) return { inputOptions: [ ], outputOptions: [ ] }
|
if (!targetBitrate) return { outputOptions: [ ] }
|
||||||
|
|
||||||
return {
|
return {
|
||||||
inputOptions: [ ],
|
|
||||||
outputOptions: [
|
outputOptions: [
|
||||||
`-preset veryfast`,
|
`-preset veryfast`,
|
||||||
`-r ${fps}`,
|
`-r ${fps}`,
|
||||||
|
@ -41,7 +40,6 @@ const defaultX264LiveOptionsBuilder: EncoderOptionsBuilder = async ({ resolution
|
||||||
const targetBitrate = getTargetBitrate(resolution, fps, VIDEO_TRANSCODING_FPS)
|
const targetBitrate = getTargetBitrate(resolution, fps, VIDEO_TRANSCODING_FPS)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
inputOptions: [ ],
|
|
||||||
outputOptions: [
|
outputOptions: [
|
||||||
`-preset veryfast`,
|
`-preset veryfast`,
|
||||||
`${buildStreamSuffix('-r:v', streamNum)} ${fps}`,
|
`${buildStreamSuffix('-r:v', streamNum)} ${fps}`,
|
||||||
|
@ -57,7 +55,7 @@ const defaultAACOptionsBuilder: EncoderOptionsBuilder = async ({ input, streamNu
|
||||||
|
|
||||||
if (await canDoQuickAudioTranscode(input, probe)) {
|
if (await canDoQuickAudioTranscode(input, probe)) {
|
||||||
logger.debug('Copy audio stream %s by AAC encoder.', input)
|
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)
|
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 })
|
logger.debug('Calculating audio bitrate of %s by AAC encoder.', input, { bitrate: parsedAudio.bitrate, audioCodecName })
|
||||||
|
|
||||||
if (bitrate !== undefined && bitrate !== -1) {
|
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 }) => {
|
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
|
// Used to get and update available encoders
|
||||||
|
|
|
@ -19,7 +19,6 @@ import {
|
||||||
uninstallPlugin,
|
uninstallPlugin,
|
||||||
updateCustomSubConfig,
|
updateCustomSubConfig,
|
||||||
uploadVideoAndGetId,
|
uploadVideoAndGetId,
|
||||||
waitFfmpegUntilError,
|
|
||||||
waitJobs,
|
waitJobs,
|
||||||
waitUntilLivePublished
|
waitUntilLivePublished
|
||||||
} from '../../../shared/extra-utils'
|
} from '../../../shared/extra-utils'
|
||||||
|
|
|
@ -341,9 +341,16 @@ 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 []
|
// All these options are optional
|
||||||
return {
|
return {
|
||||||
|
scaleFilter: {
|
||||||
|
// Used to define an alternative scale filter, needed by some encoders
|
||||||
|
// Default to 'scale'
|
||||||
|
name: 'scale_vaapi'
|
||||||
|
},
|
||||||
|
// Default to []
|
||||||
inputOptions: [],
|
inputOptions: [],
|
||||||
|
// Default to []
|
||||||
outputOptions: [
|
outputOptions: [
|
||||||
// Use a custom bitrate
|
// Use a custom bitrate
|
||||||
'-b' + streamString + ' 10K'
|
'-b' + streamString + ' 10K'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user