Question

How to read the metadata of a MKV movie files in C# (or C or C++ or AS3)?

for example such

creator
metadatacreator
hasKeyframes
hasVideo
hasAudio
hasMetaData
canSeekToEnd
duration
datasize
videosize
videocodecid
audiosize
audiocodecid
audiosamplerate
audiosamplesize
stereo
filesize
lasttimestamp
lastkeyframetimestamp
lastkeyframelocation
keyframes (filepositions, times)
width
height
framerate
videodatarate
audiodatarate
Was it helpful?

Solution

There is always attempting to parse the header yourself.

Also I've seen references to the EBML library being used to decode MKV files. Good luck!

OTHER TIPS

I recently posted C# version to https://bitbucket.org/OlegZee/nebml. It contains Title editor sample which demostrate inline editing of certain properties.

You might try asking this over at doom9 forums in their development section. Also mediainfo.dll might also work for you.

The simplest way to get a lot of this is to spawn an instance of mkvinfo and parse its output. One problem with what you are asking is that a Matroska file can have an unlimited number of video and audio streams. So you would have to enumerate the streams in the file prior to getting these properties.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top