logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Media::Convert::Asset::Concat - a Media::Convert::Asset made up of multiple assets

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.

perl v5.40.0                                       2024-12-22                 Media::Convert::Asset::Concat(3pm)

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 allfilesmustbethesameformat, 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.

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();

See Also