[FFmpeg-devel] [PATCH] FLAC timestamp

Yvan Labadie ylabadie
Wed Nov 19 10:42:24 CET 2008


Hi,
For my application a need to know the file duration, and to timestamp 
packets so I can seek...

I first read FLAC documentation and so I learn that FLAC have a variable 
bitrate and frame are not timestamped :s
then I took a look at mplayer to see how they manage to have elapsed 
time / duration / seek...
I discovered that they evaluate an average bitrate and they use it as if 
it was a constant bitrate.

So I made the same for libavformat.

I modified libavformat/raw.c with a specific read_header() for flac.
this read_header evaluate the average bitrate.
and with the bitrate information available, duration and timestamp are 
processed for each packet!

This evaluation can be far away from truth for specific kind of 
signals... but for most of normal songs it will works just fine :)

I join a patch if it can help!

NB : Sorry for the mail in libav* user I had some problems with my email 
and  ffmpeg-devel subscription...

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch_flac.diff
Type: text/x-patch
Size: 2675 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081119/a58f0712/attachment.bin>



More information about the ffmpeg-devel mailing list