[Ffmpeg-devel] [PATCH] apple caff demuxer

Justin Ruggles justinruggles
Wed Apr 4 19:21:29 CEST 2007


Michael Niedermayer wrote:
> Hi
> 
> On Wed, Apr 04, 2007 at 11:18:02AM -0400, Justin Ruggles wrote:
> [...]
> 
>>>>>>[...]
>>>>>>+
>>>>>>+    av_set_pts_info(st, 64, 1, st->codec->sample_rate);
>>>>>>+    st->start_time = 0;
>>>>>>+    st->duration = st->nb_frames;
>>>>>
>>>>>wrong, duration is in stream timebase according to demuxers and utils.c,
>>>>>btw doxy is also wrong in avformat.h.
>>>>
>>>>But 1/sample_rate is the stream timebase in this case, so 1 frame is
>>>>equivalent to 1 timebase unit.
>>>
>>>
>>>no, 1 frame is long as how many samples are in your frame, being said,
>>>one ac3 frame contains 1536 samples at 48khz, duration of one frame is
>>>1536/48000, and assuming you have 50 frames, you have 76800 samples, and
>>>duration is 76800 / 48000, not 50 / 48000.
>>
>>I think we're having a terminology mixup here.  The CAFF specification
>>uses the term "frame" to refer to 1 sample over all channels.  WAVE
>>calls this a block.  The frame you're referring to is at the codec
>>level, and is called a "packet" by CAFF.  Multiple CAFF packets can be
>>put in one AVPacket.
> 
> 
> 1 AVPacket should be 1 (codec) frame/packet, if not a AVParser is needed
> to split the AVPackets, the exception is raw audio

That is how I implemented it, but I didn't know it was a rule.
Previously I tried putting multiple AAC frames in 1 AVPacket and it
worked, probably because FAAD can accept multiple AAC frames in 1 decode
call...

-Justin





More information about the ffmpeg-devel mailing list