phpubuntuterminallibavcodecavcodec

How concatenate a array of videos using avconv


I want to concatenate a array of videos my array is

$interFIFO // array(
               0=>test1.mpg,
               1=>test2.mpg,
               2=>test3.mpg,
               3=>test4.mpg,
              );// array count may be increase some time

I know concatenate 2 video files and its working file my code is

shell_exec("cat test1.mpg test2.mpg > test_all.mpg");

The above code working file and i got result.

My problem is concatenate more than 2 videos using php and avconv


Solution

  • If your method to concatenate 2 videos works why u won't try this:

     shell_exec("cat ".implode(" ", $interFIFO)." > test_all.mpg");
    

    Implode concatenates elements of array with 'glue' as first parameter (in this case it's space ' ')