How to Convert an mkv file to mp4 by terminal

The easiest way to convert a file from Matroska container (mkv) to avi is by using the avconv tool from libav-tools, the tool that has replaced ffmpeg in the new Ubuntu distros.

How to install libav-tools in Ubuntu 12.04 and Ubuntu 12.10:

$ sudo apt-get install libav-tools

To convert mkv to mp4, use this oneliner:

$ avconv -i input.mkv -codec copy output.mp4

This tool recognisez the output file type by the file’s extension and the input file is usually autodetected. If not, use the -f flag before input/output or both, to force the file type recognition.

Tagged with: , , , , , ,
Posted in The Linux and Unix Articles!
2 comments on “How to Convert an mkv file to mp4 by terminal
  1. Charnita Fance says:

    Thank you! This is a lifesaver for newbies like me 🙂 Works perfectly and it’s a LOT faster than using a conversion app on my Mac partition.

  2. luckyhardwork says:

    You may also use iDealshare VideoGo to convert MKV to MP4, AVI, MOV, MPG, WMV etc

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Subscribe

  

Subscribe to get the latest Linux news and how to guides directly on your e-mail!