Jump to content

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.
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.