C# Wrapper for Media File Meta Data

2019-05-24 10:00发布

问题:

I am looking for a nice wrapper for extracting media file attributes dependent of file type. I am creating a bit of a generic media library that can handle video, audio, images etc. They are not just .wmv or .mp3, i would like to be able to support various formats and dont want to pigeon hole myself to an sdk like WMP SDK that seem to only support MS codecs. I have seen small write ups on a VLC wrpper that is in dev but not quite mature yet.

So, basically I would like to be able to point at a file and extract what it is. music, image, video, and then get the meta data on top of it resolution, fps, bitrate, codec if possible etc, etc being artist, album song, this I realize not be always possible.

回答1:

Try MediaInfo, should do what you want it to.



回答2:

You can use the IFilter interface which was design for Windows Desktop search, there are already implementation of the interface for MP3, WMV, JPEG.
You will need to act as an IFilter host load IFilter implementation and feed them the files, not simple but not too complicated.