[FFmpeg-devel] [patch 3/3] Make timing calculations less dependant on start_time being defined.

Michael Niedermayer michaelni
Fri Aug 24 12:40:26 CEST 2007


Hi

On Fri, Aug 24, 2007 at 12:31:13PM +0200, Michael Niedermayer wrote:
[...]
> > 
> > I note that 'utils.c' does this via av_estimate_timings_from_pts but
> > only for mpeg and mpegts.  I tried calling that if 'asf' as well, but
> > that didn't work - something got badly confused.
> > 
> > [asf @ 0x2b63e74d9780]ff asf bad header e1  at:9402
> > [asf @ 0x2b63e74d9780]invalid packet_length -511371426 at:9405
> > [asf @ 0x2b63e74d9780]freeing incomplete packet size 2437, new 4831
> > 
> > I guess it would need to be more careful about stepping over the file
> > header???
> 
> the asf demuxer is a little sensitive with having the file position moved
> around randomly like av_estimate_timings_from_pts does, and no i dont know
> precissely what is causing the problem here
> 
> also i agree that ideally we should use av_estimate_timings_from_pts for
> more formats than just mpeg (actually for all which have a
> AVInputFormat.read_timestamp() which simply means all which are capable
> to find the timestamp based on some file position
> also maybe av_estimate_timings_from_pts() should be changed to use
> read_timestamp() instead of low level seeking behind the demuxers
> back ...
> 
> but none of this is really needed for solving the start_time issue its
> needed for finding a accurate duration though if none is provided by
> the file header ... actually i dont know if there are many cases where
> thats the case
> to find the start_time simply setting it if its unknown from the
> pkt.pts after the call to av_read_frame_internal() in av_find_stream_info()
> should do the trick ...

acually iam wrong ...
we already have code to do the above and even at a more correct place
that is in update_initial_timestamps()
iam wondering why the:

if(st->start_time == AV_NOPTS_VALUE && pktl->pkt.pts != AV_NOPTS_VALUE)
    st->start_time= pktl->pkt.pts;

in there fails ...

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

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus
-------------- 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/20070824/0d34648e/attachment.pgp>



More information about the ffmpeg-devel mailing list