[FFmpeg-devel] [PATCH] dnxhd parser and raw de/muxer

Baptiste Coudurier baptiste.coudurier
Mon Sep 15 19:58:06 CEST 2008


Hi,

Michael Niedermayer wrote:
> On Mon, Sep 08, 2008 at 02:54:14PM -0700, Baptiste Coudurier wrote:
>> Hi,
>>
>> $subject, to use dnxhd raw essences.
> [...]
>> Index: libavformat/raw.c
>> ===================================================================
>> --- libavformat/raw.c	(revision 15275)
>> +++ libavformat/raw.c	(working copy)
>> @@ -487,6 +487,15 @@
>>  }
>>  #endif
>>  
>> +static int dnxhd_probe(AVProbeData *p)
>> +{
>> +    static const uint8_t header[] = {0x00,0x00,0x02,0x80,0x01};
>> +    if (!memcmp(p->buf, header, 5))
>> +        return AVPROBE_SCORE_MAX;
>> +    else
>> +        return 0;
>> +}
> 
> Can more than that be used for a more reliable probe?
> I mean yes its 5 bytes but they are all 0 except 3 bits, thus this might
> be more common in real files than expected in random data.

Well nothing can be more unreliable than mp3 probe, even .deb are probed
as mp3 ;)
Besides, after these 5 bytes, I'd need to go far to fetch interesting
data like cid, Im not sure.

>  [...]
> 
> Iam not sure if this is correct, ff_combine_frame() upates state, but
> thats just its 32bit state, it has no knowledge of the 64bit state.
> This should lead to problems when DNXHD_HEADER_PREFIX is split accross
> 2 input frames.
> 

That's possible, I had a look at aac/ac3 parser and it uses the same
mechanism so the problem might also be there, the alternatives I see is,
add an uint64_t field to pc->state, upgrade pc->state to uint64_t but
parsers might need modifications I guess, or duplicate ff_combine_frame.

Thanks for reviewing.

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
Smartjog USA Inc.                                http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA




More information about the ffmpeg-devel mailing list