Page 1 of 1

How To Append One MPG File To Another Using PHP

Posted: Thu Feb 18, 2010 8:59 am
by HappyOrangutan
How do you concat one mpg file to another using php?
I know that you can do "copy /b file1.mpg + file2.mpg newfile.mpg" in the command prompt but I want to do it in php.

Thanks!

Re: How To Append One MPG File To Another Using PHP

Posted: Thu Feb 18, 2010 9:03 am
by Bigun
I don't think it would work like that.

I would check out using ffmpeg. It can convert and resize mpgs on the server side, and I think can concatenate video as well.

Re: How To Append One MPG File To Another Using PHP

Posted: Thu Feb 18, 2010 9:07 am
by HappyOrangutan
Bigun wrote:I don't think it would work like that.

I would check out using ffmpeg. It can convert and resize mpgs on the server side, and I think can concatenate video as well.

I'm on windows so ffmpeg is not available to me. Any other suggestions? Thanks!

Re: How To Append One MPG File To Another Using PHP

Posted: Thu Feb 18, 2010 9:13 am
by Eran

Code: Select all

$command = "copy /b file1.mpg + file2.mpg newfile.mpg";
shell_exec($command);

Re: How To Append One MPG File To Another Using PHP

Posted: Thu Feb 18, 2010 9:29 am
by onion2k
You can compile ffmpeg for windows.

Re: How To Append One MPG File To Another Using PHP

Posted: Thu Feb 18, 2010 9:30 am
by Bigun

Re: How To Append One MPG File To Another Using PHP

Posted: Thu Feb 18, 2010 9:40 am
by HappyOrangutan
pytrin wrote:

Code: Select all

$command = "copy /b file1.mpg + file2.mpg newfile.mpg";
shell_exec($command);

That worked beautifully, thanks mate!