How to split and convert videos using PHP & FFMPEG?

I don't think there is any way to do this directly within PHP. Even if there was, it wouldn't be the most sensible thing to do.

I don't think there is any way to do this directly within PHP. Even if there was, it wouldn't be the most sensible thing to do. Your best bet is to hook your web application up to a command line program, such as ffmpeg, and call your system commands from the PHP script.

I'd approach this by building a job queue with your web application adding jobs to the queue and dedicated worker processes pulling from the queue, performing the task and recording the completion of the task somewhere else. This means that your users won't have to wait for the video to be re-encoded in real time.

I don't no way to split the video into segments. For convert videos look the examples here - ffmpeg.org/ffmpeg-doc.html#SEC18.

Actually, you could check into FFMPEG-PHP for grabbing still shots from the video at defined times using the $movie->getFrame() method on an ffmpeg_movie object, even to the point of allowing a user to adjust the times. Once you know the keyframes you want to split the videos on, you could execute the ffmpeg command from your PHP application. I would suggest integrating PHP Resque (based on Ruby's Resque, which I use frequently) to queue the actual execution of ffmpeg commands, since that would otherwise stall your application.

Simply set up a class with a perform() method to execute ffmpeg, and you can use PHP Resque to monitor the job status.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions