Friday, November 18, 2011

Convert MKV (h264, AC3) to MP4 (h264, AAC)

From juliensimon.blogspot.com:

We have already inspected the file, so let's extract the streams:

mkvextract tracks video.mkv 1:video.h264 2:audio.ac3

Then, we need to transcode the audio stream to AAC (let's use high-quality VBR):

ffmpeg -i audio.ac3 -acodec libfaac -aq 255 -ar 44100 -ac 2 -async 1 -vsync 1 audio.aac

Now, we'll use MP4Box to remux the initial video stream and the new audio stream into an MP4 container:

MP4Box -new -add audio.aac -add video.h264 -fps 23.976 video.mp4
AAC import - sample rate 44100 - MPEG-4 audio - 2 channels
AVC-H264 import - frame size 1280 x 720 at 23.976 FPS
Import results: 60146 samples - Slices: 1027 I 36894 P 22225 B - 1 SEI - 968 IDR
Stream uses B-slice references - max frame delay 2
Saving video-ps3.mp4: 0.500 secs Interleaving

That's it :)

1 comment:

  1. Avdshare Video Converter can Remove subtitles from MKV without recoding the original streams
    https://www.avdshare.com/remove-subtitles-from-mkv

    ReplyDelete