开发者

PHP System/Exec No Output - No Action

I'm trying to convert some videos using ffmpeg into different formats.

I have this class,

<?php

define('FFMPEG', 'C:\\cygwin\\usr\\local\\bin\\ffmpeg.exe');

class VideoEncoder {

    public function multicodeFileIntoDir($file, $directory) {
        $parts = explode('/', $file);
        $filename = $parts[count($parts)-1];

        $encode_android = FFMPEG.' -i "'.$file.'" -s 480x320 -vcodec mpeg4 -acodec aac -ac 1 -ar 16000 -r 13 -ab 32000 -aspect 3:2 "'.$directory.$filename.'.g1.mp4"';

        $encode_windows = FFMPEG.' -y -i "'.$file.'" "'.$directory.$filename.'.avi"';

        $out = shell_exec($encode_android);
        $out = shell_exec($encode_windows);

    }

}

On debugging the commands that would be run, they work as expected, and produce the correct file. The permissions on the directory I'm calling this code on has permissions as 777, $out is null, and the command has no effect.

I have error_reporting as E_ALL, and display_errors is TRUE.

An example of the command (the value of $encode_windows just before executing) is C:\cygwin\usr\local\bin\ffmpeg.exe -y -i "C:\xampp\htdocs\cams/../front/vid20110623_122802.mp4" "C:\xampp\htdocs\cams/../front/vid20110623_122802.mp4.avi"

Edit: It seems like it is writing to STDERR, somehow the output of the command is in the apache error log. Still, the output seems ok..

Any ideas? Th开发者_JAVA百科anks

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜