[FFmpeg-user] How do I read meta data? - SOLVED

Jesse Gordon tojesseg at gmail.com
Fri Nov 16 06:31:53 CET 2012

On 11/15/2012 12:41 AM, Carl Eugen Hoyos wrote:
> Jesse Gordon <tojesseg <at> gmail.com> writes:
>> How do I use ffmpeg to read the metadata on an
>> FLV file I've created with it?
> The usual way is:
> $ ffmpeg -i file.flv
> but I am sure you tried this before posting here,
> so I suspect there is something I miss.
> Carl Eugen

Thank you all for your responses. I was finally able to figure it out, I 

This is just a report of how I solved it and is for others who may be up 
against the same problem.
No need to read if you don't have my problem.

I was able to get this tool, called FLVmeta (free portable source in C 
http://code.google.com/p/flvmeta/ ) and it compiled and it can dump all 
the Metadata as well scanning in the list of keyframes and adding that 
to the meta data.

flvmeta -F filename.flv scans the source file and produces an xml list 
of all information, including the byte offset and timestamp (in 
milliseconds) for each frame, and indicates whether they are keyframes 
or inter frames. It gets this information by scanning the file itself 
and does not rely on existing metadata.

flvmeta input.flv output.flv scans input.flv and creates a list of just 
keyframes (time and byte offset) and then writes output.flv with the 
calculated time/offset table in the header.

ffmpeg does not seem to (by default) write the keyframe list to the 
header of an flv file.

ffmpeg -i and ffprobe do not seem to show the keyframe list if present, 
but just indicate that there is meta data and does show some of it.

I did get flvtool2 working - but I had to downgrade to an old version of 
ruby (1.8.7) which ironically has a bug in math.c which newer compilers 
don't like - so I had to change the word "define" to "defined" on line 
37 or so. Then it compiled.

But it turns out I didn't need flvtool2 since FLVmeta was so easy to 
compile -- and ffmpeg seems to put the keyframes list in automatically.

To verify that FLVmeta was actually writing the keyframe list (and 
reading it) to/from the header, I took my output flv file and used dd to 
chop off and save just the first 10k bytes (of a ~1M file) and even 
though only two frames played,  FLVmeta still produced the full list of 
all 27 seconds of keyframes.

Thanks again for everything!


More information about the ffmpeg-user mailing list