Fix audio bitrate for libopus

This commit is contained in:
henryruhs
2025-05-25 13:00:06 +02:00
parent 3c36440262
commit 4021ddf3b7

View File

@@ -138,7 +138,7 @@ def set_audio_quality(audio_encoder : AudioEncoder, audio_quality : int) -> Comm
audio_compression = round(numpy.interp(audio_quality, [ 0, 100 ], [ 9, 0 ])) audio_compression = round(numpy.interp(audio_quality, [ 0, 100 ], [ 9, 0 ]))
return [ '-q:a', str(audio_compression) ] return [ '-q:a', str(audio_compression) ]
if audio_encoder == 'libopus': if audio_encoder == 'libopus':
audio_bit_rate = round(numpy.interp(audio_quality, [ 0, 100 ], [ 64, 320 ])) audio_bit_rate = round(numpy.interp(audio_quality, [ 0, 100 ], [ 64, 256 ]))
return [ '-b:a', str(audio_bit_rate) + 'k' ] return [ '-b:a', str(audio_bit_rate) + 'k' ]
if audio_encoder == 'libvorbis': if audio_encoder == 'libvorbis':
audio_compression = round(numpy.interp(audio_quality, [ 0, 100 ], [ -1, 10 ]), 1) audio_compression = round(numpy.interp(audio_quality, [ 0, 100 ], [ -1, 10 ]), 1)