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

Michael Niedermayer michaelni
Mon Dec 28 02:10:07 CET 2009


On Wed, Nov 12, 2008 at 11:01:28PM -0500, David Conrad wrote:
> 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.
>

> commit b5dad233c8187289cfc674fd6a67ffdfe4734d73
> Author: David Conrad <davedc at Kozue.local>
> Date:   Wed Nov 12 22:42:47 2008 -0500
> 
>     Add a function to parse Dirac's sequence header

is this waiting for a review? applied? approved? rejected?
or in need of a maintainer? if so someone should add himself to MAINTAINERS
if no ffmpeg devel wants to maintain it i dont mind if someon from dirac
takes over maintainership of our libdirac wraper related code

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091228/b4e9a17d/attachment.pgp>



More information about the ffmpeg-devel mailing list