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 e895ac8..59f3285 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 @@ -38,7 +38,7 @@ module.exports.details = function details() { }, { name: "bitrate", - tooltip: `Specify the transcoded audio bitrate: + tooltip: `Specify the transcoded audio bitrate (optional): \\n 384k \\n 640k \\nExample:\\n @@ -63,7 +63,7 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) { infoLog: "", }; - if (inputs.codecs_to_transcode === undefined || inputs.codec === undefined || inputs.bitrate === undefined) { + if (inputs.codecs_to_transcode === undefined || inputs.codec === undefined ) { response.processFile = false; response.infoLog += "☒ Inputs not entered! \n"; return response; @@ -90,7 +90,10 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) { file.ffProbeData.streams[i].codec_name.toLowerCase() ) ) { - ffmpegCommand += ` -map 0:${i} -c:${i} ${encoder} -b:a ${inputs.bitrate} `; + ffmpegCommand += ` -map 0:${i} -c:${i} ${encoder} `; + if (inputs.bitrate != undefined) { + ffmpegCommand += `-b:a ${inputs.bitrate} `; + } hasStreamsToTranscode = true; } else if (file.ffProbeData.streams[i].codec_type.toLowerCase() == "audio") { ffmpegCommand += ` -map 0:${i}`;