Jump to content

Video encoding using PhP


electronish

Recommended Posts

If I have a folder and there is some .avi video file in it. Now, I want to compress this file using a particular codec and store it in another folder.

Is this possible using PhP ? I want the whole task to be automatic, like the script will read the folder for any new avi files , every n seconds, then on finding a new file , will encode it (using a codec which is preinstalled) and store it on another folder ?

Well, I am very new to this PhP and still am learning it, So basically  i wanted to know if there is any script already for it ? Or it can be developed ?
Link to comment
https://forums.phpfreaks.com/topic/26183-video-encoding-using-php/
Share on other sites

Well if you're using Linux you should be able to use the
shell_exec() function or the
exec() function to encode them from the command line essentially
from PHP

If you're running Windows you'll have to add the Encoders Program directory to your apache/iis list of available folders
i.e make it a virtual directory
and
run something like this

$conversion = `encoder.exe {$filename} {$outputName}`;
echo $conversion;

NOTICE those are not quotes but backticks
to the left of the 1 key on your keyboard.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.