Reputation: 1841
When reading available media types in Media Foundation is there any way of determining the chroma subsampling (i.e. 4:4:4 vs 4:2:0 etc) used for a particular MJPG format or do you have to extract that information yourself from the JPEG data once you start grabbing frames?
Upvotes: 1
Views: 208
Reputation: 69706
Short answer: you need to extract JPEG and then look into it.
Longer answer: Media Foundation does not deal with JPEGs exactly, and Motion JPEG as a sequence of JPEG images does not have to have such detail as chroma subsampling. It can even vary between frames and Motion JPEG in general is assumed to be good as long as individual frames are decodable.
It is possible that a demultiplexer reads subsampling information from track metadata or otherwise (including internally extracting that from first frame as you suggested) and then exposes it as a custom attribute on the MJPG video media type, but I doubt any of existing demultiplexers and especially stock ones is taking the trouble.
Upvotes: 1