From 168879d9ac543e64200fbd5fd91a6b2be2178aa1 Mon Sep 17 00:00:00 2001 From: Trevin Date: Fri, 30 Oct 2020 00:12:55 -0700 Subject: [PATCH] Add config option for audio transcode bitrate --- ...PEG_Transcode_Specific_Audio_Stream_Codecs.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js b/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js index 8586840..e895ac8 100644 --- a/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js +++ b/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js @@ -34,6 +34,16 @@ module.exports.details = function details() { \\nExample:\\n eac3 + `, + }, + { + name: "bitrate", + tooltip: `Specify the transcoded audio bitrate: + \\n 384k + \\n 640k + \\nExample:\\n + 640k + `, }, ], @@ -53,7 +63,7 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) { infoLog: "", }; - if (inputs.codecs_to_transcode === undefined || inputs.codec === undefined) { + if (inputs.codecs_to_transcode === undefined || inputs.codec === undefined || inputs.bitrate === undefined) { response.processFile = false; response.infoLog += "☒ Inputs not entered! \n"; return response; @@ -80,7 +90,7 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) { file.ffProbeData.streams[i].codec_name.toLowerCase() ) ) { - ffmpegCommand += ` -map 0:${i} -c:${i} ${encoder} `; + ffmpegCommand += ` -map 0:${i} -c:${i} ${encoder} -b:a ${inputs.bitrate} `; hasStreamsToTranscode = true; } else if (file.ffProbeData.streams[i].codec_type.toLowerCase() == "audio") { ffmpegCommand += ` -map 0:${i}`; @@ -104,4 +114,4 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) { response.infoLog += `☒ File has streams which aren't in desired codec! \n`; return response; } -}; \ No newline at end of file +};