noirotm / flvmeta

FLV Metadata Editor
https://flvmeta.com/
GNU General Public License v2.0
121 stars 35 forks source link

Metadata injection #1

Open noirotm opened 12 years ago

noirotm commented 12 years ago

FLVmeta must allow the injection of AMF0 metadata directly into any random point in a FLV file, using an XML file as input.

Just like the --update command, if only one file is specified, it is updated in-place, whereas specifying a second file leaves the original file untouched.

The XML file contains not only AMF0 metadata as specified by the amf0.xsd schema, but also directives allowing to specify the action to apply.

Allowed actions are:

Several such actions are permitted in one XML file. Each action operates either on a decimal address in the file, exactly representing the offset of an existing tag, either on a decimal timestamp in milliseconds, either on the name of a metadata tag which must exist in the FLV file (only the first one matches, unless a "match all" attribute is present), either with the special name EOF representing the end of the file.

In order to create entirely correct FLV files, meaning with well calculated metadata, flvmeta then invokes itself recursively at the end of the operation with an update command in order to recompute the onMetadata tag, with the --preserve option used in order not to lose any metadata inserted by the previous operation.

The new command --inject/ -I is used by specifying an optional argument, the name of the XML file containing metadata to inject. Alternatively, XML metadata can be read on stdin.

Examples: flvmeta --inject metadata.xml input.flv output.flv flvmeta -I input.flv < metadata.xml