Page 1 of 1

makemkvcon and removing the subtitles [RESOLVED]

Posted: Wed Sep 26, 2012 5:16 pm
by mw007
I am attempting to convert my DVD library (currently in ISO format) to mkv using the makemkvcon tool. I would like to preserve only the movie content (usually title 0) and just the english audio (seems to be title 1). All of my efforts have resulted in keeping the subtitles and other languages. I have tried various combinations of the makemkvcon command; here are a couple.

Code: Select all

makemkvcon mkv iso:/path/to/movie.iso all .

Code: Select all

makemkvcon mkv iso:/path/to/movie.iso 0 .
Any thoughts?

Thanks!

Re: makemkvcon and removing the subtitles

Posted: Thu Sep 27, 2012 6:24 am
by Chetwood
Subs are usually small and turned off so why not keep them?

Re: makemkvcon and removing the subtitles

Posted: Thu Sep 27, 2012 11:38 am
by mw007
Because of something like this.

Code: Select all

[mw007@localhost movies]$ ls -lh mult*
-rw-r--r-- 1 mw007 users 4.0G Aug 16 19:27 multiplicity.iso
-rw-r--r-- 1 mw007 users 3.6G Sep 23 10:19 multiplicity.mkv
Going from ISO to MKV only brought the filesize down by about 400 MB. Ideally, I'd like to get each movie to 1 GB or less.

Re: makemkvcon and removing the subtitles

Posted: Thu Sep 27, 2012 6:33 pm
by CoderJoe
mw007 wrote:Going from ISO to MKV only brought the filesize down by about 400 MB. Ideally, I'd like to get each movie to 1 GB or less.
MakeMKV generally builds lossless MKVs, i.e. preserving the original quality. To significantly reduce the filesize, you need to transcode at least one of the streams, especially the video stream. You might want to try ffmpeg (or libav), something like this:

ffmpeg -i input.mkv -acodec copy -scodec copy -vcodec libx264 -crf 18 -vpre libx264-slow output.mkv

The above command transcodes only the video stream, keeping the original audio and subtitle streams. It's is a very high quality encode and may even be perceptually lossless, but the file size will probably be larger than 1GB, depending on the type and length of movie. You can further reduce the file size by increasing the CRF value (maybe 22 or even higher), at the expense of reduced video quality. And you can also further reduce the filesize by also transcoding the audio.

Re: makemkvcon and removing the subtitles

Posted: Fri Sep 28, 2012 6:11 am
by Chetwood
No need to fiddle with command-lines when you can use Handbrake & Co. Also, VobSubs on DVDs are usually < 10 MB so it wouldn't make much of a difference keeping them.

Re: makemkvcon and removing the subtitles

Posted: Fri Sep 28, 2012 11:09 am
by mw007
Thank you everyone!
MakeMKV generally builds lossless MKVs, i.e. preserving the original quality. To significantly reduce the filesize, you need to transcode at least one of the streams, especially the video stream. You might want to try ffmpeg (or libav), something like this:

ffmpeg -i input.mkv -acodec copy -scodec copy -vcodec libx264 -crf 18 -vpre libx264-slow output.mkv
I haven't done a visual check just yet, but this definitely brought the file size down. I did have to search around for the libx264-slow.ffpreset file. It was deprecated back in April 2011: videolan.org commit.
No need to fiddle with command-lines when you can use Handbrake & Co. Also, VobSubs on DVDs are usually < 10 MB so it wouldn't make much of a difference keeping them.
I'm running this on a server that has no gui. It's a mythtv server, with multiple clients around the house.

Re: makemkvcon and removing the subtitles [RESOLVED]

Posted: Fri Sep 28, 2012 3:30 pm
by Romansh
It's still present in Libav (so you can use it via avconv).

But really, you should use -preset slow instead.

Re: makemkvcon and removing the subtitles [RESOLVED]

Posted: Fri Sep 28, 2012 3:33 pm
by mw007
Thank you! I was searching for the new functionality, as listed in the commit message.

I was searching the man pages for "preset" and was coming up empty-handed.

Re: makemkvcon and removing the subtitles

Posted: Fri Sep 28, 2012 11:17 pm
by CoderJoe
mw007 wrote:I did have to search around for the libx264-slow.ffpreset file. It was deprecated back in April 2011: videolan.org commit.
Sorry about that. It's hard to keep up with ffmpeg development. The constantly changing options are always changing constantly. :)

You can usually find all the built-in presets in /usr/share:

find /usr/share/ -name '*preset' -print

Re: makemkvcon and removing the subtitles [RESOLVED]

Posted: Fri Sep 28, 2012 11:23 pm
by mw007
No worries! At least the command technically worked. I'm not above searching for things that my distro doesn't have, old or not :D