[FFmpeg-devel] [PATCH] av_get_delay

Nicolas George nicolas.george at normalesup.org
Tue Jun 21 20:14:09 CEST 2011


Hi.

The attached patches implement an API to get the delay of an output format.
The delay is the amount of time between when a frame is fed to the format
with av_write_frame and when it is actually processed by the output format.

This is especially useful for devices, where this information is necessary
if there is need to maintain some kind of synchronization, for example
between audio and video output.

I also include the test program I used to check if that works and has the
expected effect: it is supposed to output two tones alternatively, and to
print on the terminal when the tone change. If av_get_delay() is replaced by
0, there is a visible lag (it may be necessary to replace "default" by "hw",
as "default" is usually some kind of dmix plugin, and dmix has a very short
max delay).

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-libavformat-add-an-API-to-get-the-delay.patch
Type: text/x-diff
Size: 2064 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110621/273eddf5/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-ASLA-implement-get_delay.patch
Type: text/x-diff
Size: 1148 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110621/273eddf5/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_alsa_delay.c
Type: text/x-csrc
Size: 2604 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110621/273eddf5/attachment-0002.bin>
-------------- 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/20110621/273eddf5/attachment.asc>


More information about the ffmpeg-devel mailing list