Open michpas opened 2 years ago
If you'd like to open a pr, would be easier to implement than this kinda scuffed paste. :)
hi. Haven't done this before; but tried. And opened a PR with the code suggestions. Hope this is okee now and can be pulled in
Many files have DTS and on Oled LG 2021 and 2020, Plex starts to transcode (due to no support for DTS). I have used this plugin to keep the original soundtrack, and add an EAC3 based on DTS. This works great. However for some reason plex on picks often the 1st soundtrack (DTS) and transcoding kicks in. I have updated the script to add the new (EAC3) track prior to the DTS one. Wanted to share this and ask if the script can be modified to either allow people to choose where to place new audio stream(prior or advance) or by detault put the new audiostrack prior.
The Parameter setting
{ name: "new_audiobefore", tooltip:
Please change this to "before", if you wish the new audio stream to be added prior to the original. Otherwise, leave empty \\nExample:\\n before
, },The proposd changed
for (let i = 0; i < file.ffProbeData.streams.length; i += 1) { const currStream = file.ffProbeData.streams[i]; if (currStream.codec_type.toLowerCase() === 'audio') {
if (inputs.new_audiobefore === '') { response.preset +=
-map 0:a:${indexCount}? -c:a:${streamCount} copy
; streamCount += 1; }if (inputs.new_audiobefore === 'before') { response.preset +=
-map 0:a:${indexCount}? -c:a:${streamCount} copy
; streamCount += 1; }}