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

Anuradha Suraparaju anuradha
Thu Nov 13 04:00:07 CET 2008


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.

Regards,
Anuradha






More information about the ffmpeg-devel mailing list