NAME
Media::Convert::Asset::Concat - a Media::Convert::Asset made up of multiple assets
SYNOPSIS
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();
DESCRIPTION
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.
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.
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.
ATTRIBUTES
Media::Convert::Asset::Concat
supports all attributes supported by Media::Convert::Asset plus the following:
components
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.