FLV::Cut - Extract FLV segments into new files
See FLV::Info
use FLV::Cut; my $converter = FLV::Cut->new(); $converter->add_output('first_ten_sec.flv', undef, 10_000); $converter->add_output('middle_ten_sec.flv', 20_000, 30_000); $converter->add_output('tail.flv', 40_000, undef); $converter->parse_flv('input.flv'); $converter->save_all;
Efficiently extracts segments of an FLV into separate files.
WARNING: this tool does not help you find keyframes! If you pick a cut time that is not on a keyframe, you will see unpleasant video artifacts in the resulting media. For many input FLVs, you can use the following to find the keyframe times:
my $flv = FLV::File->new; $flv->parse; $flv->populate_meta; # optional my @times = @{ $flv->get_meta('keyframe')->{times} };
Instantiate a converter.
Register an output file for a particular time slice. Either the in or out times can be undefined to imply the beginning or end of the FLV, respectively. You can set both to undef, but that's pretty pointless... If the in or out times are not represented in the input FLV, that's OK -- you may just end up with less data than you expected in the output files.
Open and parse the specified FLV file. Alternatively, you may pass an instantiated and parsed FLV::File object.
Serialize all of the extracted FLVs to file.
To install FLV::Info, copy and paste the appropriate command in to your terminal.
cpanm
cpanm FLV::Info
CPAN shell
perl -MCPAN -e shell install FLV::Info
For more information on module installation, please visit the detailed CPAN module installation guide.