Thread Rating:
  • 0 Vote(s) - 0 Average
Release - VideoSlimmer - remove unwanted audio/subs from mkv's
#1
Video 
I have created a Python script to remove unwanted audio and subtitle tracks from Matroska container formatted files, the script uses mkvmerge (from mkvtoolnix) to identify and then remove unwanted audio and subtitles.

The reason for wanting to do this is file size, i have run this script across my media library and it did save a fair amount of space (approx 60GB), i now also run this on any new media i have recently acquired.

So without further ado here is a link to it, you will find the installation, syntax and examples here:-

link to prereq's and usage:-
https://github.com/binhex/videoslimmer

link to source here:-
https://github.com/binhex/videoslimmer/releases

There is one known bug which is related to multiple matching items for the defined language, this currently causes the movie to be skipped, so if there are two English audio streams for instance it wont be able to process the file and will skip it.
Reply
#2
cool tool. The only potential drawback I can see is with dubbed languages. For example, there may be a foreign film with a dubbed English track. Obviously, many people prefer to watch with subtitles in this case. I don't know if there is a way to check the original language.

In my case, I would prefer that the tool remove all languages that are non-original.
Reply
#3
(2014-12-08, 19:25)blamblip Wrote: cool tool. The only potential drawback I can see is with dubbed languages. For example, there may be a foreign film with a dubbed English track. Obviously, many people prefer to watch with subtitles in this case. I don't know if there is a way to check the original language.

In my case, I would prefer that the tool remove all languages that are non-original.

hmm an interesting point, i guess i could build in logic that if the video stream is not english then do not strip any audio tracks, issue is with that approach that the video streams are not always labelled and often set to und (undefined), as you pointed out possibly some external lookup to identify the movie as "foreign" may work.

just incase anybody is concerned they may end up with no audio for some mkv files, videoslimmer will not remove audio/subtitle tracks if your preferred language is not found, thus for example movies such as Das Boot keeps the original german, unless your preferred audio language is found.
Reply
#4
Thanks for the tool. Not even using it to save space -- which is also nice -- but because some players don't properly play english if it's not in the track 1 spot, so this helps with situations with streaming through Plex to friends, or using PlexSync, and it defaults to wrong language.
HTPC: Intel NUC BOXD34010WYKH1 | Panasonic TC-P50S30 | Denon AVR-1712, Jamo S606 HC3 5.0 | Logitech Harmony One
Server: Supermicro MBD-X10SL7-F-O | Intel Xeon E3-1231V3 | 16GB DDR1600 ECC | Fractal Design Node 804 | 3 WD Red 3TB, 3 WD Red 4TB, 1 WD Red 6TB
Reply
#5
(2015-02-17, 18:33)Silvaire Wrote: Thanks for the tool. Not even using it to save space -- which is also nice -- but because some players don't properly play english if it's not in the track 1 spot, so this helps with situations with streaming through Plex to friends, or using PlexSync, and it defaults to wrong language.

ahh an interesting use case :-), glad your making good use of it, i still run it over my media collection on a weekly basis to catch new media added that may have unwanted audio and subtitle tracks, working well for me!
Reply
#6
Thank you for the tool!!! I am running it now and it looks like it is running great so far!.

How hard would it be to make a script or to add a feature that would add the filename (minus the extension) to the title field of the mkv file? I noticed that every once in a while I get files that have garbage in the title field and it shows up in vlc or in some movie players that prioritize the file tags.
Reply
#7
Hi, well it's been a while since I looked at the code but it shouldn't be too hard I wouldnt think. I too still use this to keep my library in tip top condition, so im glad your making use also :-). I will take a look and see how much effort it would take to add in the feature.​
Reply
#8
Hi binhex01,

Any luck on finding a way to make the script also clean out or update the title field? So many people throw garbage in that field. Thanks!
Reply
#9
Hi binhex01,
Does it work with multiple preferred audio/subtitle languages?

Thanks.
Reply
#10
(2016-08-25, 09:57)boulogne75 Wrote: Hi binhex01,
Does it work with multiple preferred audio/subtitle languages?

Thanks.
In a word, no, can you give me an example as to when this might be required, im stumped as to the reason to want this, surely the preferred will always be your mother tongue, i cant really see why you would need multiple preferred?.
Reply
#11
(2016-08-23, 08:25)hiphutch Wrote: Hi binhex01,

Any luck on finding a way to make the script also clean out or update the title field? So many people throw garbage in that field. Thanks!

im working on this right now, should hopefully have a new release in the next few days.
Reply
#12
(2016-08-25, 11:28)binhex01 Wrote: In a word, no, can you give me an example as to when this might be required, im stumped as to the reason to want this, surely the preferred will always be your mother tongue, i cant really see why you would need multiple preferred?.

I speak natively french and spanish but I watch everything in its original language (mostly english movies/tvseries). When family and friends come home, some only speak spanish and some only speak french.
Depending with whom I am, I need also spanish and french Smile
Reply
#13
(2016-08-25, 11:34)binhex01 Wrote:
(2016-08-23, 08:25)hiphutch Wrote: Hi binhex01,

Any luck on finding a way to make the script also clean out or update the title field? So many people throw garbage in that field. Thanks!

im working on this right now, should hopefully have a new release in the next few days.

This is now complete, i have also added an option to delete the title metadaata as well, release is 1.0.3 on github.
Reply
#14
(2016-08-25, 20:25)boulogne75 Wrote:
(2016-08-25, 11:28)binhex01 Wrote: In a word, no, can you give me an example as to when this might be required, im stumped as to the reason to want this, surely the preferred will always be your mother tongue, i cant really see why you would need multiple preferred?.

I speak natively french and spanish but I watch everything in its original language (mostly english movies/tvseries). When family and friends come home, some only speak spanish and some only speak french.
Depending with whom I am, I need also spanish and french Smile

ok that explains it Big Grin i can look into adding this in, i think the way i will code it up is there will be a pref-lang and extra-lang flags, the extra-lang can then supply multiple additional languages.
Reply
#15
(2016-09-06, 22:28)binhex01 Wrote: ok that explains it Big Grin i can look into adding this in, i think the way i will code it up is there will be a pref-lang and extra-lang flags, the extra-lang can then supply multiple additional languages.

Thanks for taking time to look into this. That will make an extremely useful script for me. 3000 movies/100 tvshows so no way to do it manually Smile
Reply



VideoSlimmer - remove unwanted audio/subs from mkv's00