binhex Posted December 18, 2014 Share Posted December 18, 2014 Hi guys, 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 100GB), 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 Let me know how you get on with it, any questions please post here and i will get back to you. 1 Quote Link to comment
cirkator Posted December 18, 2014 Share Posted December 18, 2014 Sounds really cool! Will definitely give this a go. Thanks! Quote Link to comment
binhex Posted December 18, 2014 Author Share Posted December 18, 2014 Sounds really cool! Will definitely give this a go. Thanks! Excellent! Please let me know how you get on, quick word of warning, whilst I have tested this extensively and run it against my own media collection (approx 1000 movies), I would advise that you copy a few movies to a test area and make sure the resulting files are what you expected. Any feature requests also welcome. binhex. Quote Link to comment
sgibbers17 Posted December 19, 2014 Share Posted December 19, 2014 When I create my MKVs using makemkv I leave out all the extra audio and subs but keep the forced subs. My only problem is on some movies the forced sub in the MKV does not have the default flag after ripping. What I have done to fix this is to use mkvmerge to change the flag to default. Can this script be used to take the subs and add the default flag. Quote Link to comment
Brucey7 Posted December 19, 2014 Share Posted December 19, 2014 I process all my movies with mkvmerge to add-in (if separate) or keep all the audio tracks and subtitles, setting the default play language to English, or English subs if foreign audio and setting the forced flag on subs that should be English forced. Resulting filename would be... Notebook, The (2004) HD1080p,TH,FR,DE,IT.mkv It makes it really easy to search for a movie with (say) Thai audio or subs so my kids can watch it with me, just windows search for ",TH" (we live in Thailand) Quote Link to comment
stchas Posted July 19, 2015 Share Posted July 19, 2015 @binhex, Do you have [64-bit] mkvtoolnix binaries for unRAID 6.0 that you can share. I'm not quite ready to put a development system together so I can run the SlackBuilds package myself. Kevin Quote Link to comment
methanoid Posted July 30, 2017 Share Posted July 30, 2017 @binhex This is a great idea. A friend wrote his own version but not as good! Just started (and aborted) a large dry run. Looks good and thank you for adding that requested function ;) Is there (didnt get to end!) a way to stop it reporting warnings for each JPG, AVI etc file (the screen scrolls past very quick!)? Does it also report total savings at the end of a run? Is there an easy way to add this to say SABnzbd downloading as a script so each downloaded movie gets auto processed? I see someone asked for that for NZBget over at your github but no response. Seems a great idea to me. Then all you need do is run the script on your whole library ONCE and clean as you download Quote Link to comment
TRusselo Posted September 30, 2019 Share Posted September 30, 2019 (edited) Attempting to run this on my windows machine to slim my Unraid share. installed MKVtoolnix installed python v2.7.16 CMD - Administrator cd c:\videoslimmer\ VideoSlimmer.py --mkvmerge "c:\Program Files\mkvtoolnix\mkvmerge.exe" --media \\BIG-D\movies --lang eng keep getting error on all mkv files : 2019-09-29 20:04:24,016 INFO VideoSlimmer videoslimmer :: Processing file \\BIG-D\movies\Guardians of the Galaxy Vol. 2 (2017)\Guardians of the Galaxy Vol. 2 (2017) - 4K HDR.mkv 2019-09-29 20:04:24,109 WARNING VideoSlimmer videoslimmer :: mkvmerge failed to identify file %s any ideas what im doing wrong? i get this error on every mkv, my first run was not dry and it did not alter one file of 2000 movies.... NEVERMIND.... I found a program called MKV Optimizer. Windows program with GUI. Nice and simple for a noob like me. Edited September 30, 2019 by TRusselo Quote Link to comment
liquidsmoke Posted January 27, 2020 Share Posted January 27, 2020 Hi, I am also seeing this issue with video slimmer! "WARNING VideoSlimmer videoslimmer :: mkvmerge failed to identify file %s" Please Help! Quote Link to comment
TRusselo Posted March 7, 2022 Share Posted March 7, 2022 is there anything in the script / tool options to prevent deleting the only audio stream if its not the matching language? what if i have ONE german film with english subs, it does not have an english audio stream. would it delete the only german audio stream? Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.