[FFmpeg-devel] [PATCH] av_get_delay

Nicolas George nicolas.george at normalesup.org
Wed Jun 29 19:06:09 CEST 2011


Le primidi 11 messidor, an CCXIX, Michael Niedermayer a écrit :
> i didnt say that.

Sorry I misunderstood.

> This doesnt seem to work very well for example when you have:
> a slideshow with commentary, the delay from the video stream could
> make quite big jumps an be constant between them. It might be
> better to add the remaining duration of the currently displayed frame
> in there or something

What about something like that then:

/**
 * Get the delay for the selected stream, in time_base units.
 * The exact meaning of that delay depends on the format.
 * For real-time muxers, data submitted to the muxer more than delay ago
 * should have been output (e.g. presented to the user), while data
 * submitted less than delay ago should be still somewhere in the muxer or
 * some hardware buffer.
 * Note that packets interleaving may introduce an additional delay.
 * If the format does not support delay measurement, the return value is
 * AV_NOPTS_VALUE.
 */
int64_t av_get_output_delay(AVFormatContext *s, int stream);

?

> i think these are unneeded
> last_in_packet_buffer provides the last added and thus its timestamps

Indeed.

> and the muxer has to know itself whats the last on the presenttation
> side IMHO

Some muxers may not care to keep track.

Anyway, for this last part, unless I am mistaken, there is a strict
separation:

	delay_total = delay_interleave + delay_output

The original patch gives delay_output, and is useful by itself. Maybe the
delay_interleave part can wait until someone actually needs it and therefore
can test it for usability.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110629/03b935c0/attachment.asc>


More information about the ffmpeg-devel mailing list