How to convert mkv to mp4


I’m using Ubuntu linux and would like to know how to convert mkv (
matroska ) media file to mp4 format so I can play this file on my PS3
console. It seems that MKV video format is not supported on

thank you


try this:

first install prerequisites:

sudo apt-get install libav-tools gpac mkvtoolnix normalize-audio faac

then create a bash script with following content:


cd "`pwd`"

avconv -i $1 -vn -acodec pcm_s16le -ac 2 $audiofile.wav &> /dev/null
normalize-audio $audiofile.wav  &> /dev/null
faac -c 48000 -q 100 $audiofile.wav &>/dev/null
mkvextract tracks $1 1:$videofile.h264 &> /dev/null
MP4Box -fps 23.976 -add $videofile.h264 -add $audiofile.aac ${1%.*}.mp4 &> /dev/null

# cleanup
rm $audiofile $videofile

make it executable and run it with a single argument and that is a file in mkv format:

$ chmod +x
$ ./ file.mkv

the above will produce a new file.mp4

hope it helps