[Ffmpeg-devel] Re: [RFC] Improvement for the oddtimestampgeneration when parser is in use.

Michael Niedermayer michaelni
Tue Mar 20 02:54:04 CET 2007


Hi

On Tue, Mar 20, 2007 at 01:51:10AM +0100, elupus wrote:
> "Michael Niedermayer" <michaelni at gmx.at> wrote in message 
> news:20070319224809.GS26096 at MichaelsNB...
> 
> >> Hmm, yea that could work. How about using need_parsing |=4 since that 
> >> has
> >> already been used to determin behavior of parser subsystem. The just 
> >> reuse
> >> available duration/bitrate?
> >
> >if it works and is clean then iam not opposed
> 
> Here are two patches with an idea on how to do it. First one is totally 
> untested as i figured I was heading in the wrong direction when I started, 
> but now i'm not so sure.
> 
> parser1.patch, handles the timestamp correction in libavformat and not in 
> parser. (albeit currently misusing the parser context internal flags 
> variable). it makes no change in the semantic on when to output timestamps 
> >from parser allthough it could do so based on that flag in the same 
> >approach 
> that the second patch does.
> 
> parser2.patch does all calculations in parser, wich makes it usable outside 
> avformat. It uses the bit_rate that ac3 and atleast aac parsers sets. 
> HOWEVER, currently it isn't working due to time_base not being set in 
> AVCodecContext, and it has no access to the streams timebase. (with 
> time_base fixed up, it works thou).

using AVCodecContext.time_base is totally wrong


> 
> Just wondering what direction i should move here. Either I make this a 
> specific feature to avformat, and have parser just have a flag saying it 
> should give byte offset from last available timestamp, any other users of 
> parser could do same calculations as avformat would do when that flag is 
> set.

well iam not entirely sure either which way is best but either way you cannot
add fields into the middle of AVCodecParserContext that breaks the ABI and
would need a mjor version bump adding fields to the end of the struct might be
ok

also from the current position in the chunk the current chunks timestamp
and the size of the frame all are trivially known you can just update 
the timestamp outside the parser completely bypassing the parsers messing 
with timestamps, iam not saying thats clean but no doubt simple

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

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070320/eb15fdfc/attachment.pgp>



More information about the ffmpeg-devel mailing list