After a bit of fiddling I figured out how to use flvtool2 to overwrite the existing metadata values for an flv or even add completely new name value pairs.
In most circumstances the video tool used to encode an flv will insert a few values into the file’s metadata. Typically you will find properties such as duration, width, height, etc. stored in the file allowing you to to respond to the data when the flv’s onMetaData event fires.
You can also use flv metadata “injectors” such as flvtool2 to do this for you if your encoder failed to insert the data, or you wish to augment the metadata (the injectors often add additional metadata that is not included by the encoder).
However, it can sometimes be useful to change the values set by the encoder / injector. For example, perhaps I’ve performed a cut operation on an flv with flvtool2 and would now like the duration to reflect the new timestamp value. In this scenario you use flvtool2′s “-key:value” switch to change the value of an existing property, or key.
Here’s a short video illustrating how to overwrite existing metadata values using flvtool2.
You can also add completely new name / value pair to an flv’s metadata:
flvtool2 -U -drummer:Portnoy example.flv
If you’re interested in more commands take a look at the flvtool2 wiki.
Wow, April has been a busy month:)
Thanks, I’ve been looking how to modify the metadata for ages, even though I’ve already been using flvtool2, I wasn’t aware of customizing the metadata values.
Hi Brooks,
How can I up the nested metadata values, keyframes:fileposition: and keyframes:times: in particular?
Thanks for your time and help.
-P
keyframes:
filepositions:
times:
-UP -smth:smth smth.flv [out.flv]
Does not work.
It shows a desired result only in stdout, but really the field being changed stays the same.
I have flvs with wrong videocodecid.
I tried this:
flvtool2.exe -UP -videocodecid:2 1.flv
After the applying MediaInfo shows the codec as it was.
Wonderful article. Really far better discussed!