From 5fb7cfbac50e2c55f04182e40bc6f84e5dd4a4da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Le=20Calvar?= Date: Sat, 3 Apr 2021 18:48:14 +0200 Subject: add support for inputOptions in trancode plugins --- server/lib/video-transcoding-profiles.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'server/lib') diff --git a/server/lib/video-transcoding-profiles.ts b/server/lib/video-transcoding-profiles.ts index b7f9178c4..d802e2c9d 100644 --- a/server/lib/video-transcoding-profiles.ts +++ b/server/lib/video-transcoding-profiles.ts @@ -24,9 +24,10 @@ import { VIDEO_TRANSCODING_FPS } from '../initializers/constants' const defaultX264VODOptionsBuilder: EncoderOptionsBuilder = async ({ input, resolution, fps }) => { const targetBitrate = await buildTargetBitrate({ input, resolution, fps }) - if (!targetBitrate) return { outputOptions: [ ] } + if (!targetBitrate) return { inputOptions: [ ], outputOptions: [ ] } return { + inputOptions: [ ], outputOptions: [ `-preset veryfast`, `-r ${fps}`, @@ -40,6 +41,7 @@ const defaultX264LiveOptionsBuilder: EncoderOptionsBuilder = async ({ resolution const targetBitrate = getTargetBitrate(resolution, fps, VIDEO_TRANSCODING_FPS) return { + inputOptions: [ ], outputOptions: [ `-preset veryfast`, `${buildStreamSuffix('-r:v', streamNum)} ${fps}`, @@ -55,7 +57,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, outputOptions: [] } + return { copy: true, inputOptions: [ ], outputOptions: [ ] } } const parsedAudio = await getAudioStream(input, probe) @@ -70,14 +72,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 { outputOptions: [ buildStreamSuffix('-b:a', streamNum), bitrate + 'k' ] } + return { inputOptions: [ ], outputOptions: [ buildStreamSuffix('-b:a', streamNum), bitrate + 'k' ] } } - return { outputOptions: [ ] } + return { inputOptions: [ ], outputOptions: [ ] } } const defaultLibFDKAACVODOptionsBuilder: EncoderOptionsBuilder = ({ streamNum }) => { - return { outputOptions: [ buildStreamSuffix('-q:a', streamNum), '5' ] } + return { inputOptions: [ ], outputOptions: [ buildStreamSuffix('-q:a', streamNum), '5' ] } } // Used to get and update available encoders -- cgit v1.2.3