Jump to content

Wrong or no codecs detected in .MKV files


Recommended Posts

A high percentage of video files in torrents nowadays are in the .MKV (Matroska Video) format. uTorrent, under the "Files" tab on the bottom half of the screen, has various columns where it displays data about each file. One of the columns is headed "Codecs". The data in this column is usually wrong and/or incomplete. This is true for all 3.x.x versions I've tried (currently on 3.3.2 build 30260, but it's exactly the same on all other 3.x.x versions).

Specific examples: most video files in torrents nowadays use the H.264 video codec. However, uTorrent incorrectly identifies all of them as having the XVID video codec instead. XVID is a generic version of H.263 (a.k.a. MPEG-4 Part 2 or MPEG-4 Visual), not H.264 (a.k.a. MPEG-4 Part 10 or MPEG-4 AVC). At least this is true when the container format for the video files is Matroska (.MKV).

Another example: the most common audio codec in video files nowadays is the AAC audio codec. While uTorrent successfully detects this in Matroska (.MKV) video files about 2/3 of the time, 1/3 of the time it doesn't detect the audio codec at all.

So, with a bunch of files in .MKV format with H.264 video and AAC audio, uTorrent displays "A: aac V: XVID" about 2/3 of the time, and "A: V: XVID" about 1/3 of the time, on any 3.x.x version. One program that displays correct information about any multimedia file is MediaInfo, currently at version 0.7.64, which is open source, so you can look at its source code if you need to know how to detect codecs correctly. Or for documentation on the Matroska container format and how to identify video and audio streams in it and which codecs they use you can consult the documentation at http://matroska.org/technical/specs/codecid/index.html. Specific, more up-to-date documentation on identifying codecs in .MKV files is provided by Haali at http://haali.su/mkv/codecs.pdf in a PDF file.

I can see how you mixed up XVID and H.264. In .MKV, H.264 is identified as "V_MPEG4_ISO_AVC", while XVID is identified as "V_MPEG4_ISO_ASP". The only difference is the last 2 letters... VC versus SP. Typically though there is also a FourCC similar to in the .AVI container format. It is probably simplest to detect the first video track and first audio track listed in the Matroska header, and list which codecs they use. Files with multiple video tracks are quite rare, and files with multiple audio tracks usually have the same codec for all the different audio tracks. So detecting the first video track and listing its codec, and detecting the first audio track and listing its codec, that is good enough. Listing the codec for every single track would be overkill, for files that have multiple audio tracks, especially since they're pretty much guaranteed to all be in the same audio codec, typically just in different languages or maybe there is a track with director commentary.

Anyway I hope you found this bug report informative. I suppose it isn't a terribly urgent bug, since it doesn't involve the program crashing or any difficulties downloading or anything of that level of importance, but displaying incorrect information to the end user about which codecs are in a file is still... well... wrong. But more of an annoyance than anything else, because people who do look at the codec column eventually learn it isn't accurate, and then detect it themselves after downloading. Still, I would suggest that this bug is somewhat important, because some people start downloading a file and expect it to have a certain codec and if it turns out to be something different then they might not want it. Like for instance XVID video is lower quality than H.264 but they both get detected as XVID, but maybe if you detected them correctly, people who want H.264 would know immediately after they start downloading a video that's in XVID and cancel the download so they can get a better version. That's just one example why you should fix this bug, since knowing what the file is is essential. And all that info is in the header of the file, right at the beginning, so after you get the first piece of the file downloaded, you can detect the codecs in the file (and typically videos have several hundred pieces to download).

Link to comment
Share on other sites

BitTorrent protocol clients do not have a concept of "files" so have to rely on the operating system providing such details.

Windows Media Player, which is used by Windows Explorer to get the media file properties does not have 'native' tools for Matroska so cannot return the information 100% accurately

And all that info is in the header of the file,
MKV tags and attachment data are actually in the last segments (chunks) of the file.
Link to comment
Share on other sites

"Codecs". The data in this column is usually wrong

Right, this one irritates me too. They should find a way to make it right, regardless of what M$ thinks... :(

BTW, the audio codec is blank most of the times, and is not less important! With today's systems being used with HTPC connected to your audio system, being DTS/DD/2.0/5.1 is important!


Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...