PHP video manipulation?

I was wondering if there is a server-side script for managing audio / video files? By controlling, I mean encoding / decoding and a video fragment into several clips and encoding / decoding them, etc.?

I looked at the FFMPEG project , but I wonder what other solutions might be ...

+4
source share
2 answers

In terms of manipulating video through PHP, there is no way to do this directly through PHP. All solutions revolve around using exec to call an external library for editing.

Call FFMPEG from PHP

A good example of this approach can be found here:

The following is an example of running ffmpeg from php:

<?php exec("ffmpeg -i video.mpg -an -r 10 -y -s 320x240 video%d.jpg"); ?> 

Also, check out the following library: http://ffmpeg-php.sourceforge.net/

Call VLC from PHP

Quote from http://en.wikipedia.org/wiki/VLC_media_player :

The VLC media player supports many compression methods for audio, video and file formats, including DVD-Video, video CD, and streaming protocols. It is capable of transmitting through a computer network and transcoding multimedia files.

VLC can also be called via the command line of the exec method to perform transcoding, streaming, and basic video editing functions such as rotation and cropping.

Mencoder Challenge

Again, another option is to use the Mencoder tool, which is "free decoding, encoding, and command line filtering released under the GNU General Public License." - http://en.wikipedia.org/wiki/MEncoder .

Example:

 <?PHP echo "ENCODING\n"; exec ("start mencoder \"mf://../../*.jpg\" -ofps 25 -o ../test.flv -of lavf -ovc lavc -lavcopts vcodec=flv:keyint=50:vbitrate=600:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -vop scale=320:240 -lavfopts video"); echo "\nDONE"; ?> 
+1
source

you can use virtualdub, anyway, to do this in PHP, you need to use the exec () function.

-2
source

All Articles