You are not logged in.

#1 2009-03-17 19:47:03

Acecero
Member
Registered: 2008-06-21
Posts: 1,373

[SOLVED] Mux H264 + subtitles -> mkv

Does anyone know how to extract H264 video and AAC audio from an mp4 container?

I want to be able to mux those with ASS subtitles into a mkv container.

Last edited by Acecero (2009-03-17 21:44:37)

Offline

#2 2009-03-17 20:03:30

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: [SOLVED] Mux H264 + subtitles -> mkv

You can use FFmpeg to simply change the container and mkvtoolnix to add the subtitles. The FFmpeg part is simple:

ffmpeg -i <YOUR_INPUT>.mp4 -vcodec copy -acodec copy <YOUR_OUTPUT>.mkv

I don't know what the state of libass is in FFmpeg. If the code is in, you could use that too. But, I can't test it without any subtitles.

--EDIT--

I just read somewhere that mkvmerge from mkvtoolnix can also make the conversion from mp4 to mkv. It may be easiest just to use one tool.

Offline

#3 2009-03-17 21:43:45

Acecero
Member
Registered: 2008-06-21
Posts: 1,373

Re: [SOLVED] Mux H264 + subtitles -> mkv

Actually using FFmpeg and mkvtoolnix together was probably what I needed.

Before I made this thread I did attempt to do the easiest way:

mkvmerge -o <OUTPUT>.mkv <INPUT>.mp4 <INPUT>.ass

But that method did not work out. There was a freeze frame for the first few seconds of the video, probably due to the incompatibility with mp4 and ASS.

Using your method with FFmpeg to transfer the video and audio codecs to mkv helped because then all I had to do was mux the subtitles:

mkvmerge -o <OUTPUT>.mkv <INPUT>.mkv <INPUT>.ass

Video worked perfectly.

Last edited by Acecero (2009-08-29 18:34:22)

Offline

#4 2009-03-17 23:08:37

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: [SOLVED] Mux H264 + subtitles -> mkv

mkvmerge even has a gui *cough*

start "mmg"


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#5 2009-03-17 23:28:42

Acecero
Member
Registered: 2008-06-21
Posts: 1,373

Re: [SOLVED] Mux H264 + subtitles -> mkv

I wasn't even aware of a gui version.

It's nice, thanks for mentioning it. Is there anything else I should I know?

Offline

Board footer

Powered by FluxBB