Converting MKV to MP4
In order to convert an H.264 mkv video to mp4 without losing quality, the tool avconv can be used. It is part of the libav-tools package. In order to install, run:
sudo apt-get install libav-tools
(If using jonseverinsson's ppa you will get the version from the ffmpeg group).
Using the tools
Run the following command to convert the file:
avconv -i [source] -codec copy [dest]