diff options
Diffstat (limited to 'server/lib/video-transcoding-profiles.ts')
-rw-r--r-- | server/lib/video-transcoding-profiles.ts | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/server/lib/video-transcoding-profiles.ts b/server/lib/video-transcoding-profiles.ts index d802e2c9d..81f5e1962 100644 --- a/server/lib/video-transcoding-profiles.ts +++ b/server/lib/video-transcoding-profiles.ts | |||
@@ -24,10 +24,9 @@ import { VIDEO_TRANSCODING_FPS } from '../initializers/constants' | |||
24 | 24 | ||
25 | const defaultX264VODOptionsBuilder: EncoderOptionsBuilder = async ({ input, resolution, fps }) => { | 25 | const defaultX264VODOptionsBuilder: EncoderOptionsBuilder = async ({ input, resolution, fps }) => { |
26 | const targetBitrate = await buildTargetBitrate({ input, resolution, fps }) | 26 | const targetBitrate = await buildTargetBitrate({ input, resolution, fps }) |
27 | if (!targetBitrate) return { inputOptions: [ ], outputOptions: [ ] } | 27 | if (!targetBitrate) return { outputOptions: [ ] } |
28 | 28 | ||
29 | return { | 29 | return { |
30 | inputOptions: [ ], | ||
31 | outputOptions: [ | 30 | outputOptions: [ |
32 | `-preset veryfast`, | 31 | `-preset veryfast`, |
33 | `-r ${fps}`, | 32 | `-r ${fps}`, |
@@ -41,7 +40,6 @@ const defaultX264LiveOptionsBuilder: EncoderOptionsBuilder = async ({ resolution | |||
41 | const targetBitrate = getTargetBitrate(resolution, fps, VIDEO_TRANSCODING_FPS) | 40 | const targetBitrate = getTargetBitrate(resolution, fps, VIDEO_TRANSCODING_FPS) |
42 | 41 | ||
43 | return { | 42 | return { |
44 | inputOptions: [ ], | ||
45 | outputOptions: [ | 43 | outputOptions: [ |
46 | `-preset veryfast`, | 44 | `-preset veryfast`, |
47 | `${buildStreamSuffix('-r:v', streamNum)} ${fps}`, | 45 | `${buildStreamSuffix('-r:v', streamNum)} ${fps}`, |
@@ -57,7 +55,7 @@ const defaultAACOptionsBuilder: EncoderOptionsBuilder = async ({ input, streamNu | |||
57 | 55 | ||
58 | if (await canDoQuickAudioTranscode(input, probe)) { | 56 | if (await canDoQuickAudioTranscode(input, probe)) { |
59 | logger.debug('Copy audio stream %s by AAC encoder.', input) | 57 | logger.debug('Copy audio stream %s by AAC encoder.', input) |
60 | return { copy: true, inputOptions: [ ], outputOptions: [ ] } | 58 | return { copy: true, outputOptions: [ ] } |
61 | } | 59 | } |
62 | 60 | ||
63 | const parsedAudio = await getAudioStream(input, probe) | 61 | const parsedAudio = await getAudioStream(input, probe) |
@@ -72,14 +70,14 @@ const defaultAACOptionsBuilder: EncoderOptionsBuilder = async ({ input, streamNu | |||
72 | logger.debug('Calculating audio bitrate of %s by AAC encoder.', input, { bitrate: parsedAudio.bitrate, audioCodecName }) | 70 | logger.debug('Calculating audio bitrate of %s by AAC encoder.', input, { bitrate: parsedAudio.bitrate, audioCodecName }) |
73 | 71 | ||
74 | if (bitrate !== undefined && bitrate !== -1) { | 72 | if (bitrate !== undefined && bitrate !== -1) { |
75 | return { inputOptions: [ ], outputOptions: [ buildStreamSuffix('-b:a', streamNum), bitrate + 'k' ] } | 73 | return { outputOptions: [ buildStreamSuffix('-b:a', streamNum), bitrate + 'k' ] } |
76 | } | 74 | } |
77 | 75 | ||
78 | return { inputOptions: [ ], outputOptions: [ ] } | 76 | return { outputOptions: [ ] } |
79 | } | 77 | } |
80 | 78 | ||
81 | const defaultLibFDKAACVODOptionsBuilder: EncoderOptionsBuilder = ({ streamNum }) => { | 79 | const defaultLibFDKAACVODOptionsBuilder: EncoderOptionsBuilder = ({ streamNum }) => { |
82 | return { inputOptions: [ ], outputOptions: [ buildStreamSuffix('-q:a', streamNum), '5' ] } | 80 | return { outputOptions: [ buildStreamSuffix('-q:a', streamNum), '5' ] } |
83 | } | 81 | } |
84 | 82 | ||
85 | // Used to get and update available encoders | 83 | // Used to get and update available encoders |