[Ffmpeg-devel] FLV files: use of audio timestamps

Siddharth Mathur smathur
Tue Jan 31 22:48:51 CET 2006

Hello all, 

In an FLV (Flash) file, each audio/video packet has a timestamp associated
with it. This timestamp value is in milliseconds and can be extracted from
the packet header. For example, the flv_read_packet() function in flvdec.c
reads this value as follows: 
	pts = get_be24(&s->pb);

In certain (fairly common) scenarios, the timestamp of the first audio
packet is offset by (say) 0.5 sec from the timestamp of the first video
packet. FFMPEG currently seems to throw away this information when
converting from the FLV format, and as a result audio and video timescales
may be skewed. For example, I decoded an FLV ( audio offset of ~0.4sec) to
an AVI file with PCM audio and RAW video, and lip-sync problems can be seen.

Any pointers on how I should troubleshoot and fix this problem in the ffmpeg


More information about the ffmpeg-devel mailing list