Avoid ffmpeg to lose the flv files keyframes

I use ffmpeg to convert my files, but when I do so, I lose the keyframes metadata from my flv files.

The command I use right now is:

$/usr/local/bin/ffmpeg -i %s -ab 96k -ar 44100 -b 500k -r 25 -f flv %s

How can I avoid ffmpeg to delete the keyframes info?

Regards

Zeeshan


Solution 1:

Even though the metadata can be lost during any conversion step, it is always possible to regenerate them later.

There are a few tools that can be used to regenerate keyframe informations, including:

  • flvmeta (tool that I have developed)
  • yamdi
  • flvtool2
  • flvtool++
  • flvmdi

Solution 2:

Try adding the following argument:

-map_meta_data 0:0

This should copy the metadata of the first stream of the input file to the first stream of the output file. More information can be found here: http://ffmpeg.org/ffmpeg-doc.html#SEC12