Convert using ffmpeg without exec

My Windows XP, Apache, PHP 5.3 and ffmpeg are working fine. I need to convert flv to avi or vice versa without using a command exec(). Is it possible?

Thanks.

edit: I hope someone can edit the ffmpeg source and implement the exec function in the php extension so that we can just add parameters to the function (ex $ fmpeg-> exec (here exec parameters);) so that exec is executed directly of extension ...

and compile these files: p

+2
source share
8 answers

, , , ffmpeg - (, exec, system) PHP.

: safe_mode. exec:

. , safe_mode_exec_dir....

ffmpeg safe_mode_exec_dir. , . ...

PHP: PHP ffmpeg . , - , ffmpeg.

, , , . , . .

+3

exec() - , " ", unix- cronjob Windows, php- script php-.

http://www.makeuseof.com/tag/bring-linux-cron-like-power-to-windows/ http://www.visualcron.com/

a) , . , .

b) 15 - php script, jar-file # -executable ffmpeg . , "" , "archive", .

+2

- . , - , . - . .

, . .

, PHP Perl - . FLV . , perl php frameworks exec ffmpeg

0

Another option would be to use Sukhozin. You could at least limit exactly where the system call can and, in turn, restrict access to this directory.

Here is a basic vhost.conf configuration example where shell_exec is locked everywhere in your domain except for ffmpeg-folder using Suhosin

<virtualhost *:80>
ServerName your.server
DocumentRoot "/var/your/public_html"
php_admin_value suhosin.executor.func.blacklist "shell_exec, passthru, show_source, system, pcntl_exec, popen, pclose, proc_open, proc_nice, proc_terminate, proc_get_status, proc_close, leak, apache_child_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, escapeshellcmd, escapeshellarg, exec"

<Directory "/var/your/public_html/ffmpeg-folder">
php_admin_value suhosin.executor.func.blacklist "passthru, show_source, system, pcntl_exec, popen, pclose, proc_open, proc_nice, proc_terminate, proc_get_status, proc_close, leak, apache_child_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, escapeshellcmd, escapeshellarg, exec"
</Directory>
</virtualhost>
0
source

Try using pclose(popen($cmd, 'r'));exec () instead

0
source

Perhaps you can connect to ssh in php and execute the commands there.

-1
source

Source: https://habr.com/ru/post/1710735/


All Articles