How To Append One MPG File To Another Using PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
HappyOrangutan
Forum Newbie
Posts: 3
Joined: Thu Feb 18, 2010 8:04 am

How To Append One MPG File To Another Using PHP

Post 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!
Bigun
Forum Contributor
Posts: 237
Joined: Tue Jun 13, 2006 10:50 am

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

Post 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.
HappyOrangutan
Forum Newbie
Posts: 3
Joined: Thu Feb 18, 2010 8:04 am

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

Post 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!
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

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

Post by Eran »

Code: Select all

$command = "copy /b file1.mpg + file2.mpg newfile.mpg";
shell_exec($command);
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

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

Post by onion2k »

You can compile ffmpeg for windows.
Bigun
Forum Contributor
Posts: 237
Joined: Tue Jun 13, 2006 10:50 am

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

Post by Bigun »

HappyOrangutan
Forum Newbie
Posts: 3
Joined: Thu Feb 18, 2010 8:04 am

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

Post by HappyOrangutan »

pytrin wrote:

Code: Select all

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

That worked beautifully, thanks mate!
Post Reply