FLV::File - Parse Flash Video files
This is a subclass of FLV::Base.
Prepare an empty FLV. This is only needed if you do not plan to call the parse() method.
Reads the specified file. If the file does not exist or is an invalid FLV stream, an exception will be thrown via croak().
There is no return value.
Fill in various
onMetadatafields if they are not already present.
Serializes the in-memory FLV data. If that representation is not complete, this throws an exception via croak(). Returns a boolean indicating whether writing to the file handle was successful.
Returns a hash of FLV metadata. See File::Info for more details.
Returns the filename, if any.
- $self->set_meta($key, $value, ...);
These are convenience functions for interacting with an
onMetadatatag at time 0, which is a common convention in FLV files. If the zeroth tag is not an FLV::MetaTag instance, one is created and prepended to the tag list.
These methods return the FLV::Header and FLV::Body instance, respectively. Those will be
undefuntil you call either empty() or parse().
The following methods are only used during the parsing phase.
$nbytes off the active filehandle and returns them as a string. Throws an exception if the filehandle is closed or hits EOF before all the bytes can be read.
Returns a string representing the current position in the filehandle. This is intended for use in debugging or exceptions. An example of use: indicate that an input value five bytes behind the read head is erroneous.
die 'Error parsing version number at byte '.$self->get_pos(-5);
Returns a boolean indicating if the FLV stream is exhausted. Throws an exception if the filehandle is closed.