Here's what I do manually for .avi files (I believe I found this in
ubuntuforums.org):
cat video1 video2 ... > tempfile
mencoder -oac copy -ovc copy -forceidx -o tempfile2 tempfile
after this, you can just feed tempfile2 to ffmpeg to convert it to mp4.
--- mike t.
>
>From: Zak Elep <zak...@gmail.com>
>To: Philippine Linux Users' Group (PLUG) Technical Discussion List
><plug@lists.linux.org.ph>
>Sent: Tuesday, January 25, 2011 13:10:04
>Subject: Re: [plug] php script to concatenate video files (to h264) using
>ffmpeg
>& named pipes
>
>
>Backticks smells. :P
>There's posix_mkfifo() and ffmpeg-php extension. Why not use them? :)
>
>On Jan 24, 2011 9:28 PM, "Winelfred G. Pasamba" <winelfredpasa...@gmail.com>
>wrote:
>> <?php
>> //
>> // concatenate videos (using ffmpeg and named pipes)
>> //
>> // Winelfred G. Pasamba c2011
>> //
>>
>> if ($argc <= 1) {
>> die ("usage: php joinvideos.php video1 video2 video3 ... videoall\n");
>> }
>>
>> $phpfile = array_shift ($argv);
>> echo "# php file is: $phpfile\n";
>>
>> $finalfile = array_pop($argv);
>> echo "# final file is: $finalfile\n";
>>
>> foreach ($argv as $arg) {
>> echo "# Making pipe: fifo.$arg.mpg \n";
>> $cmd = "mkfifo fifo.$arg.mpg\n";
>> `$cmd`;
>> }
>>
>> foreach ($argv as $arg) {
>> echo "# Preparing pipe source: $arg\n";
>> $cmd = "ffmpeg -i $arg -sameq -y fifo.$arg.mpg > /dev/null < /dev/null&\n";
>> echo $cmd;
>> `$cmd`;
>> }
>>
>> $cmd = "cat ";
>> foreach ($argv as $arg) {
>> $cmd .= "fifo.$arg.mpg ";
>> }
>> //$cmd .= " | ffmpeg -f mpeg -i - -sameq -vcodec libx264 -vpre medium
>> -ac 1 -ab 128k $finalfile";
>> $cmd .= " | ffmpeg -f mpeg -i - -sameq -vcodec libx264 -vpre medium
>>$finalfile";
>> echo "# Executing: $cmd\n";
>> echo $cmd."\n";
>> `$cmd`;
>>
>> foreach ($argv as $arg) {
>> echo "# Removing pipe: fifo.$arg.mpg\n";
>> $cmd = "rm fifo.$arg.mpg"."\n";
>> `$cmd`;
>> }
>>
>> if someone can add more sense to this, that would be welcome :)
>> _________________________________________________
>> Philippine Linux Users' Group (PLUG) Mailing List
>> http://lists.linux.org.ph/mailman/listinfo/plug
>> Searchable Archives: http://archives.free.net.ph
>
_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
http://lists.linux.org.ph/mailman/listinfo/plug
Searchable Archives: http://archives.free.net.ph