Tdarr_Plugins
Tdarr_Plugins copied to clipboard
[Plugin Request] Only Keep Highest Quality Video Stream
I'd like to request a plugin which can handle removing extraneous Video Streams.
Could someone build a plugin that deletes all but the highest quality video stream, WITH one important configuration option: "Keep video streams with different titles"
Sometimes an MKV will have multiple video streams, but this is specifically to allow inbuilt editions, or visual commentary pointers. In those cases, the stream will (hopefully) be named/titled as such. Hence the option to keep streams with different titles.
So when... True: keep the highest quality version per named stream. EX: file has two video streams with no name (undefined), and a video stream with Commentary for the name. The highest quality undefined stream will be kept, along with the commentary stream. False: keep the highest quality video stream, regardless of naming. EX: for the above example, instead the only stream kept would be whichever was highest quality.
Here you go
Unzip and add to local no inputs needed
Simple logic
- Aborts if file medium is not Video line 97
- Aborts if only one video stream exists line 112
- Loops over video stream
- Removes video stream that are NOT first and have no title tag line 132
FFmpeg argument
general '-map 0 -c copy -max_muxing_queue_size 9999'
add if removing -map -0:v:${id}
File is largely untested and should be used at your own risk Feel free to modify and use as needed
and I did miss something a comma Preset ' -map 0 -c copy -max_muxing_queue_size 9999 ' Needs to be ' , -map 0 -c copy -max_muxing_queue_size 9999 '
needs that comma
Hello, thank you very much for the plugin, it did appear to work (I did make that adjustment).
Updated copy, for anyone who sees this: Tdarr_Plugin_tws101_Video_Stream_Remove.zip
Would it be possible to change this to not just go by first video stream, but instead highest quality? I don't mean to be a choosing beggar, but I had a couple files with dual streams and:
- The test file with two NAMED streams retained both. So the "video commentary" was retained.
- The test file with two unnamed streams retained the top one, but in this case the top one was lower quality.
I realize that's a hell of a corner case (two video streams, and they are in the 'wrong' order), but if possible I think it would be better to analyze resolution and/or encoder and keep only the highest quality.