Mihir Mehta
Mihir Mehta

Reputation: 13843

How can i detect CODEC in MPMoviePlayerController in iphone-sdk

When Video is made with the Sorenson CODEC... MPMoviePlayerController just plays Audio(and not the Video), Instead i want to show my custom error message at this point. How can i detect which CODEC is used by particular File programmatically ... ?

EDIT: I am not using Quick time in my code so that solution won't work

Thanks

Upvotes: 1

Views: 842

Answers (1)

Sylverb
Sylverb

Reputation: 939

Check this documentation to understand the Quicktime file format : http://developer.apple.com/library/mac/documentation/QuickTime/QTFF/qtff.pdf

The field you are looking for is the "vfmt" code that is containing the video fourcc code (there is one for each video track in your file, so take care if your file is containing several video tracks). The fourcc codes for Sorenson codec are "SVQ1" and "SVQ3".

Now you'll have to write some code to parse the QT file to find the correct atom, extract the "vfmt" value and compare it to SVQ1/SVQ3 !

Apple is providing some classes to easily parse quicktime files, but it is only available on Mac OS, not on iOS !

Upvotes: 1

Related Questions