[FFmpeg-devel] [PATCH] Function to parse Dirac sequence header

David Conrad lessen42
Thu Nov 13 05:01:28 CET 2008


On Nov 12, 2008, at 10:00 PM, Anuradha Suraparaju wrote:

> Hi,
>
> On Tue, 2008-11-11 at 04:28 -0500, David Conrad wrote:
>> On Nov 9, 2008, at 4:29 AM, Michael Niedermayer wrote:
>>
>>> On Wed, Nov 05, 2008 at 11:22:01PM -0500, David Conrad wrote:
>>>> Hi,
>>>>
>>>> This will be useful for both the dirac parser and ogg demuxer (and
>>>> future
>>>> native dirac decoder of course.)
>>>> Adapted from the soc repository.
>>>
>>> I think the parser should not need this, av_find_stream_info()
>>> should call
>>> the decoder to fill in missing information. That assumes there is a
>>> decoder
>>> that does set it ...
>>>
>>> about the ogg demuxer iam not sure if its needed or not ...
>>
>> The problem with ogg is that the only place the stream time_base is
>> stored is in a codec-dependent way. Theora, FLAC, and Vorbis also  
>> have
>> to parse their first setup packet to find this, the difference is  
>> that
>> they don't use vlc and default tables so it's just simple reads at
>> known offsets.
>>
>> The decoder will set the time_base in AVCodecContext, but I'm not  
>> sure
>> how the time_base in AVStream would get set correctly if the demuxer
>> doesn't set it.
>
> This is what I am doing in my local tree.
>
> in ffdirac_header
> -----------------
>
> st->need_parsing = AVSTREAM_PARSE_HEADERS;
> ( This ensures that the decoder is invoked during av_find_stream_info
> call)
>
> in ffdirac_gptopts
>
> if (st->codec->time_base.num && st->codec->time_base.den)
> 		st->time_base = st->codec->time_base;
>
> It appears to be an overkill to check the codec timebase and set the
> stream time base in every call to ffdirac_gptopts, but the check is
> required if we don't want to decode the Dirac sequence header in
> ffdirac_header.

There's still the issue that the duration isn't set; this is something  
that imo should be done when possible, which it is for nearly all ogg  
files.

At any rate I made some changes in the soc tree to this function.  
Updated version attached.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dirac-sequence.txt
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081112/7d1ce36e/attachment.txt>
-------------- next part --------------




More information about the ffmpeg-devel mailing list