Batch convert MKV to MP4 with subtitles

gslrider

macrumors 6502
Original poster
Nov 4, 2005
319
7
I know Handbrake can convert MKV files with subtitles to MP4/M4V. You select the MKV file, go to subtitles, and choose the english version. Pretty simple. But how would I do this with multiple MKV files, without having to keep an eye when one is done, so that I can load the next file. I can't seem to figure out a way to batch convert multiple MKV files while retaining the subtitles for each file. If not Handbrake, is there any other way for me to accomplish this? Pretty tedious with having to do it one at a time in Handbrake. Thanks
 

orph

macrumors 68000
Dec 12, 2005
1,861
382
UK

orph

macrumors 68000
Dec 12, 2005
1,861
382
UK
@wlossw ops i missed that, yes if you dont need to re-encode the video and just want to change the container then an app that lets you pass thro the video etc and just change the container is worth a look.
I think FFmpeg can also do this https://ffmpeg.org/download.html
lots of hits on google
looks like for ffmpeg you want something like '-vcodec copy -acodec copy'
 

vasuvasu

macrumors member
Aug 8, 2011
31
3
What you really want to do is copy the h264 video and aac/ac3/dts audio out of a mkv container, into a mp4 container. This is mostly a file duplication operation (apart from audio encoding if needed), and will be MUCH faster than re-encoding the video track.

http://www.emmgunn.com/mp4tools-home/

You can batch convert, and it'll copy subs over.
 

h9826790

macrumors G5
Apr 3, 2014
12,800
5,622
Hong Kong
What you really want to do is copy the h264 video and aac/ac3/dts audio out of a mkv container, into a mp4 container. This is mostly a file duplication operation (apart from audio encoding if needed), and will be MUCH faster than re-encoding the video track.

http://www.emmgunn.com/mp4tools-home/

You can batch convert, and it'll copy subs over.
Yeah, I am also thinking why re-encode everything again, but not simply re-mux (e.g. via Subler) them into MP4. That's few hundred times faster.
 

orph

macrumors 68000
Dec 12, 2005
1,861
382
UK
used to love QuickTime for being able to cut and mess with videos without re encoding in the old days :).
shame on apple for letting QuickTime just be reduced to more of a video player without an alternative to take up the slack.
 
  • Like
Reactions: Synchro3

h9826790

macrumors G5
Apr 3, 2014
12,800
5,622
Hong Kong
used to love QuickTime for being able to cut and mess with videos without re encoding in the old days :).
shame on apple for letting QuickTime just be reduced to more of a video player without an alternative to take up the slack.
You can still do that with quick time now, as long as the video is playable in quick time.
 

orph

macrumors 68000
Dec 12, 2005
1,861
382
UK
oo ill have to check then, been using quicktime 7 still for most things
 

gslrider

macrumors 6502
Original poster
Nov 4, 2005
319
7
Figured it out. In Handbrake, hit Open Source, and choose the entire folder (not individual files). It will load all the files in that folder. The next steps have to be done manually. Once all the files are loaded, select each one (one at a time) from the source drop down bar. Go to subtitles, and choose the correct subtitle you want to embed. Once that is done, hit Add To Queue. Then follow the same procedure with all the other files. Once you've done that, hit the Queue button, and double check that the subtitles have been accepted (hit the arrow key beside each file and scroll down the bottom of the list. Subtitles should indicate the subtitle you chose. Once you've confirmed, hit the Start button. Go have a coffee, cook, clean, watch tv, and wait. At least you don't have to keep going back for each file.
 
  • Like
Reactions: orph

rajsharma714

macrumors newbie
Jul 25, 2017
8
1
Hi,

I have a MKV video, is there a way for me to tell if I can just change the container to MP4, or if I need to transcode the video to MP4?

Thanks in advance!
 

McScooby

macrumors 6502a
Oct 15, 2005
602
302
The Paps of Glenn Close, Scotland.
Hi,

I have a MKV video, is there a way for me to tell if I can just change the container to MP4, or if I need to transcode the video to MP4?

Thanks in advance!
Check out Smart Converter (or Pro if you're happy with the results for batch processing) on the MAS, 9/10 times it just works, bought it years ago after tirelessly fighting with handbrake etc, never looked back!:)
 

h9826790

macrumors G5
Apr 3, 2014
12,800
5,622
Hong Kong
Hi,

I have a MKV video, is there a way for me to tell if I can just change the container to MP4, or if I need to transcode the video to MP4?

Thanks in advance!
An apps called Mediainfo can tell you what exactly inside the container. Anyway, most MKV files are just H.264 coding inside, 99% can be remux into MP4 in a minute.
 

gslrider

macrumors 6502
Original poster
Nov 4, 2005
319
7
Hi,

I have a MKV video, is there a way for me to tell if I can just change the container to MP4, or if I need to transcode the video to MP4?

Thanks in advance!
You need to transcode. I use iFFMpeg for all my transcoding. The only container I know you can change to mp4 is m4v. Changing the extension has worked fine for me.
 

rajsharma714

macrumors newbie
Jul 25, 2017
8
1
You need to transcode. I use iFFMpeg for all my transcoding. The only container I know you can change to mp4 is m4v. Changing the extension has worked fine for me.
This is the opposite of what @h9826790 has stated. But either way, what's the difference between using iFFMpeg vs Handbrake? Handbrake is free, where as iFFMpeg looks like is a paid software.
 

h9826790

macrumors G5
Apr 3, 2014
12,800
5,622
Hong Kong
ffmpeg is not iFFMpeg, the "i" make a big difference.

In fact, iFFMpeg is just a software charge the user to provide GUI (basic functions) for FFMpeg. For complicated stuff, still need to enter command in iFFMpeg to finish the job. And I don't think iFFMpeg has GUI for remux.

Edit: I am sorry for my over react, may be you just want to introduce FFMpeg to him, but not misread iFFMpeg as FFMpeg. Sorry about that.

This is the opposite of what @h9826790 has stated. But either way, what's the difference between using iFFMpeg vs Handbrake? Handbrake is free, where as iFFMpeg looks like is a paid software.
And NO, no need to transcode or encode. You can indeed remux it via a free software called Subler (GUI).

Or FFMpeg (the free one), in terminal with command

ffmpeg -i source.mkv -c copy destination.mp4

Do not transcode the video just for changing container unless really required, remux is hundred times faster, and no lost.
[doublepost=1501093097][/doublepost]
You need to transcode. I use iFFMpeg for all my transcoding. The only container I know you can change to mp4 is m4v. Changing the extension has worked fine for me.
Change container is NOT rename.

Yes you can rename M4V into MP4 and still work properly. But you can also change container for a video (e.g. from MKV to MP4) and the video still valid for players. This process called remux, it's a bit more complicated than rename. But no encoding involve, so hundred times faster than transcode.
[doublepost=1501095769][/doublepost]I just made a video to shows how to perform this remux with FFMpeg in command line.

As you can see in the video, it's super fast. Even the original video is only 13s long, normal transcoding still require few seconds to process. And remux actually finish within half second. And in the video, it actually shows the speed is 365x. That's more than 20000 FPS, way faster than normal transcoding.

After remux, the new video is in MP4 format, and it's playable with the exact same content as the original video, same bitrate, same resolution, same codec, etc.

 
Last edited:
  • Like
Reactions: Sovon Halder

h9826790

macrumors G5
Apr 3, 2014
12,800
5,622
Hong Kong
Here is another video to demo how fast remux compare to normal transcode.

I pick a relative small MP4 video (~400MB, 1hr 21min long) and remux it into MKV this time.

The speed is > 30000 FPS, finish to "reformat" into MKV in just few seconds.

 

gslrider

macrumors 6502
Original poster
Nov 4, 2005
319
7
This is the opposite of what @h9826790 has stated. But either way, what's the difference between using iFFMpeg vs Handbrake? Handbrake is free, where as iFFMpeg looks like is a paid software.
I find iFFMpeg much easier to use, especially if your doing a batch. It also works for video to audio.

But Handbrake works well too (minus video to audio). If you don't want to spend the money, Handbrake will work.