mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-14 01:36:08 -07:00
Merge pull request #553 from HaveAGitGat/strict_arg
Add -strict -2 for truehd
This commit is contained in:
commit
6971befead
1 changed files with 10 additions and 4 deletions
|
|
@ -24,6 +24,12 @@ module.exports = function transcodeAddAudioStream(
|
||||||
audioCodec = "mp3";
|
audioCodec = "mp3";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let extraArgs = "";
|
||||||
|
|
||||||
|
if (audioEncoder === 'truehd') {
|
||||||
|
extraArgs = " -strict -2";
|
||||||
|
}
|
||||||
|
|
||||||
//Step 1: Check if the file already has the required stream codec/langtag/channel count
|
//Step 1: Check if the file already has the required stream codec/langtag/channel count
|
||||||
|
|
||||||
var hasStreamAlready = file.ffProbeData.streams.filter((stream) => {
|
var hasStreamAlready = file.ffProbeData.streams.filter((stream) => {
|
||||||
|
|
@ -122,7 +128,7 @@ module.exports = function transcodeAddAudioStream(
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
preset: `,-map 0:v -map 0:${highestChannelCount.index} -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 ${audioEncoder} -ac ${channelCount} -max_muxing_queue_size 9999`,
|
preset: `,-map 0:v -map 0:${highestChannelCount.index} -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 ${audioEncoder} -ac ${channelCount} -max_muxing_queue_size 9999${extraArgs}`,
|
||||||
processFile: true,
|
processFile: true,
|
||||||
note: `The required channel count ${channelCount} is lower than the highest available channel count (${highestChannelCount.channels}). Adding! \n`,
|
note: `The required channel count ${channelCount} is lower than the highest available channel count (${highestChannelCount.channels}). Adding! \n`,
|
||||||
};
|
};
|
||||||
|
|
@ -155,7 +161,7 @@ module.exports = function transcodeAddAudioStream(
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
preset: `,-map 0:v -map 0:${highestChannelCount.index} -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 ${audioEncoder} -ac ${highestChannelCount.channels} -max_muxing_queue_size 9999`,
|
preset: `,-map 0:v -map 0:${highestChannelCount.index} -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 ${audioEncoder} -ac ${highestChannelCount.channels} -max_muxing_queue_size 9999${extraArgs}`,
|
||||||
processFile: true,
|
processFile: true,
|
||||||
note: `The required channel count (${channelCount}) is higher than the highest channel available in specified lang tag (${highestChannelCount.channels}). Adding lower channel track. \n`,
|
note: `The required channel count (${channelCount}) is higher than the highest channel available in specified lang tag (${highestChannelCount.channels}). Adding lower channel track. \n`,
|
||||||
};
|
};
|
||||||
|
|
@ -229,7 +235,7 @@ module.exports = function transcodeAddAudioStream(
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
preset: `,-map 0:v -map 0:${highestChannelCount.index} -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 ${audioEncoder} -ac ${channelCount} -max_muxing_queue_size 9999`,
|
preset: `,-map 0:v -map 0:${highestChannelCount.index} -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 ${audioEncoder} -ac ${channelCount} -max_muxing_queue_size 9999${extraArgs}`,
|
||||||
processFile: true,
|
processFile: true,
|
||||||
note: `The required channel count ${channelCount} is lower than the highest available channel count (${highestChannelCount.channels}). Adding! \n`,
|
note: `The required channel count ${channelCount} is lower than the highest available channel count (${highestChannelCount.channels}). Adding! \n`,
|
||||||
};
|
};
|
||||||
|
|
@ -260,7 +266,7 @@ module.exports = function transcodeAddAudioStream(
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
preset: `,-map 0:v -map 0:${highestChannelCount.index} -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 ${audioEncoder} -ac ${highestChannelCount.channels} -max_muxing_queue_size 9999`,
|
preset: `,-map 0:v -map 0:${highestChannelCount.index} -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 ${audioEncoder} -ac ${highestChannelCount.channels} -max_muxing_queue_size 9999${extraArgs}`,
|
||||||
processFile: true,
|
processFile: true,
|
||||||
note: `The required channel count (${channelCount}) is higher than the highest channel available in specified lang tag (${highestChannelCount.channels}). Adding lower channel track. \n`,
|
note: `The required channel count (${channelCount}) is higher than the highest channel available in specified lang tag (${highestChannelCount.channels}). Adding lower channel track. \n`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue