Media::Convert::Asset::Concat - a Media::Convert::Asset made up of multiple assets
use Media::Convert::Asset; use Media::Convert::Asset::Concat; use Media::Convert::Pipe; my $file1 = Media::Convert::Asset->new(url => $input_file_1); my $file2 = Media::Convert::Asset->new(url => $input_file_2); my $input = Media::Convert::Asset::Concat->new(url => "/tmp/concat.txt", components => [$file1, $file2]); my $output = Media::Convert::Asset->new(url => $output_file); Media::Convert::Pipe->new(inputs => [$input], output => $output, vcopy => 1, acopy => 1)->run();
The ffmpeg command has a "concat" file format, selected with -f concat, which is essentially a text file containing a header, followed by a number of URLs to other files.
ffmpeg
-f concat
When ffmpeg is asked to read from such a file, it will start reading from the first file, and then move on to the next file when the data from the first file is complete.
In order for this to work well, note that all files must be the same format, to beyond the level that Media::Convert::Asset can detect. It is probably not safe to use Media::Convert::Asset::Concat except on files that were created from the same recording.
Media::Convert::Asset
Media::Convert::Asset::Concat
Since the files should be the same, Media::Convert::Asset::Concat assumes that they are, and will run ffprobe on only the first of its components when requested.
ffprobe
Media::Convert::Asset::Concat supports all attributes supported by Media::Convert::Asset plus the following:
Should be an array of Media::Convert::Asset objects making up the contents of this asset.
To add more components, the add_component handle exists.
add_component
To install Media::Convert, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Media::Convert
CPAN shell
perl -MCPAN -e shell install Media::Convert
For more information on module installation, please visit the detailed CPAN module installation guide.