[Libav-user] Determining video container format of streamed file after url_open

Alex Cohn alexcohn at netvision.net.il
Sun May 6 12:25:08 CEST 2012

On Sun, May 6, 2012 at 11:28 AM, Jean-Yves Avenard <jyavenard at gmail.com> wrote:
> On 6 May 2012 17:05, Alex Cohn <alexcohn at netvision.net.il> wrote:
>> The difference between mp4 and m4v is often illusionary, see
>> http://en.wikipedia.org/wiki/M4V and
>> https://discussions.apple.com/thread/2309476?start=0&tstart=0 for some
>> details. The big issue is DRM, which may render the mv4 file
>> impossible to decode with ffmpeg. The AC3 (Dolby Digital) audio which
>> may be embedded in m4v, but never mp4 - is less of a problem for your
>> decoder.
> I guess I didn't explain myself properly..
> I want to distinguish mp4/m4vm from all others containers (be it AVI,
> mkv, whatever)
> It's not about distinguishing mp4 vs m4v...

It's very easy to check for mov file format: open it, read first 8
bytes, and check for '\0\0\0' . 'ftyp'. Note that byte number 3 is not

see http://echoone.com/filejuicer/formats/mov-repair for more info.

Alex Cohn

More information about the Libav-user mailing list