Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

VideoSlimmer - remove unwanted audio/subs from mkv's

Featured Replies

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.

Sounds really cool!

Will definitely give this a go.

Thanks!

  • Author

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.

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.

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)

  • 7 months later...

@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

  • 2 years later...

@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 ;)

 

  • 2 years later...

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 by TRusselo

  • 3 months later...

Hi,

I am also seeing this issue with video slimmer!
"WARNING VideoSlimmer videoslimmer :: mkvmerge failed to identify file %s"

 

Please Help!

  • 2 years later...

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?

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.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.