
mp4 vs mkv

Answer 1 :
“Best” implies that it has criteria for comparison, but did not specify what those criteria might be.

MKV and MP4 are container formats. MKV more or less allows any type of audio and video streaming to be in a container. MP4 is defined by the MPEG format and uses a simplified version of Apple Quicktime as a container and restricts the codecs used to those specified in the MPEG standard.
Regarding the characteristics of the container format, QuickTime> Matroska> MP4.
In terms of support for the container format by other programs and players, MP4 >> QuickTime> Matroska (in commercial applications QuickTime is more compatible and open source Matroska may have a slight advantage).
As for container format codec support, Matroska >> QuickTime> MP4. Matroska has been specifically designed to be a universal container and to support content in any encoding. The practical problem, of course, is that you can store content in encodings that other people don’t have a decoder for. QuickTime technically also supports any type of streaming like Matroska, but the spec only mentions about 20 videos and 12 audio codecs, so anything other than the one you don’t expect will work in situations where QuickTime is used (in fact, some of the more obscure codecs are not well supported outside of macOS). On the other hand, MP4 is quite restrictive, but this restriction is also an advantage, because something related to MP4,
As for the quality of the content, it is determined by the codecs used in the container and not by the container itself. Matroska, MP4, and QuickTime may contain HEVC (h.265) content, which is the best you’ll find today. In practice, h.264 is the most supported (mainly due to patent licensing issues), and all containers handle h.264 well.
So which one is better will depend a lot on your criteria.
Answer 2:
MKV was endorsed by a French non-profit organization founded by Steve Lomme. An open standard that can be used free of charge, and technical specifications are available for private and commercial use. The MKV development team licenses its libraries under the LGPL.
Pros:
Supports H.264 / AVC for optimal playback of HD content
Supports Blu-ray rips and HD video playback
Better support some functions like subtitles, multiple tracks and audio and video chapters.
Disadvantages:
The saved files are larger.
Additional features may require additional tools and applications.
Use different file formats for different video functions (.MK3D for stereoscopic video, .MKA for audio files, and .MKS for subtitles).
The MP4 container format was developed by the International Organization for Standardization (ISO) and is designed to support a wide variety of media players along with a variety of multimedia devices. This format is compatible with all default media players.
Pros:
Various MP4 files are easier to save
Large or separate files can be saved to a movie file
MP4 files are easier to use in terms of copying, moving, and downloading.
Disadvantages:
The highest resolution for MP4 is 1440×1080 / 30p (16: 9).
Audio channel and sample rate are only available in 2ch / 48kHz.
MP4 uses the MPEG-4 AAC LC audio codec, which is a low complexity codec.
Both have their pros and cons.



