I have a shell script for converting any video into mp4 format(using ffmpeg) . I want to write a php script for executing ffmpeg to convert any video format into mp4 video format .
Here is the shell script : http://pastebin.com/PH3QWFqQ
Shell script running good without shell_exec() .
Update:
I have tried doing it by using shell_exec() but i am getting an error :
PHP Parse error: syntax error, unexpected T_STRING in test1.php on line 33
UPDATE:
I have tried with shell_exec() :
It executes but not showing any output . But the .sh file alone shows output
The easiest way would probably be using
shell_exec, but you really need to make sure that no user inputs get directly into the command. You really don’t want your users to execute commands on your servers shell.Example:
shell_exec("ffmpeg ...");If you don’t want to use
shell_exec, just google “ffmpeg php”, there are some ffmpeg extensions for PHP. I found this one, for example: http://ffmpeg-php.sourceforge.net/