mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-15 18:25:54 -07:00
Add config option for audio transcode bitrate
This commit is contained in:
parent
3286b51dcf
commit
168879d9ac
1 changed files with 13 additions and 3 deletions
|
|
@ -34,6 +34,16 @@ module.exports.details = function details() {
|
||||||
\\nExample:\\n
|
\\nExample:\\n
|
||||||
eac3
|
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: "",
|
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.processFile = false;
|
||||||
response.infoLog += "☒ Inputs not entered! \n";
|
response.infoLog += "☒ Inputs not entered! \n";
|
||||||
return response;
|
return response;
|
||||||
|
|
@ -80,7 +90,7 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) {
|
||||||
file.ffProbeData.streams[i].codec_name.toLowerCase()
|
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;
|
hasStreamsToTranscode = true;
|
||||||
} else if (file.ffProbeData.streams[i].codec_type.toLowerCase() == "audio") {
|
} else if (file.ffProbeData.streams[i].codec_type.toLowerCase() == "audio") {
|
||||||
ffmpegCommand += ` -map 0:${i}`;
|
ffmpegCommand += ` -map 0:${i}`;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue