1

noob to php-ffmpeg. have it installed. Can get it to do some things, so might be installed right.

I've boiled it down to the crux of the problem:

$file="appL.mp4";
$config = array(
'ffmpeg.binaries' => '/usr/local/bin/ffmpeg',
'ffprobe.binaries' => '/usr/local/bin/ffprobe',
'timeout' => 3600, // The timeout for the underlying process
'ffmpeg.threads' => 12, // The number of threads that FFMpeg should use
);

// create the ffmpeg object
$ffmpeg = FFMpeg\FFMpeg::create($config, null);

// open video file
$video = $ffmpeg->open($file);
$format = new FFMpeg\Format\Video\x264();
$format->setAudioCodec("aac");
$video->save($format,'fixed-appL.mp4');

gives this error:

    Fatal error: Uncaught Alchemy\BinaryDriver\Exception\ExecutionFailureException: 
ffmpeg failed to execute command ..

This is the command:

'/usr/local/bin/ffmpeg' '-y' '-i' 'appL.mp4' '-threads' '12' '-vcodec' 'libx264' '-acodec' 'aac' '-b:v' '1000k' '-refs' '6' '-coder' '1' '-sc_threshold' '40' '-flags' '+loop' '-me_range' '16' '-subq' '7' '-i_qfactor' '0.71' '-qcomp' '0.6' '-qdiff' '4' '-trellis' '1' '-b:a' '128k' '-pass' '1' '-passlogfile' '/var/tmp/ffmpeg-passes5ba3a8cc109416z2zr/pass-5ba3a8cc10a2c' 'fixed-appL.mp4'

So, when I copy the command into the terminal, I get this error:

    ratecontrol_init: can't open stats file
    Error initializing output stream 0:0 
-- Error while opening encoder for output stream #0:0 
- maybe incorrect parameters such as bit_rate, rate, width or height

BUT, if I delete off the file name in the tmp folder and change it to:

'/usr/local/bin/ffmpeg' '-y' '-i' 'appL.mp4' '-threads' '12' '-vcodec' 'libx264' '-acodec' 'aac' '-b:v' '1000k' '-refs' '6' '-coder' '1' '-sc_threshold' '40' '-flags' '+loop' '-me_range' '16' '-subq' '7' '-i_qfactor' '0.71' '-qcomp' '0.6' '-qdiff' '4' '-trellis' '1' '-b:a' '128k' '-pass' '1' '-passlogfile' '/var/tmp/' 'fixed-appL.mp4'

then it's ok. (probably because I'm trying to affect a temp file that no longer exists?

0 Answers0