Jump to content

EXEC'd ffmpeg doesn't really run


burningdan

Recommended Posts

Thank you SO MUCH for your time in helping me.

 

I'm trying to convert videos using ffmpeg, exec'd from a php page.

I've created a shell script that uses all the ffmpeg options I want and takes 2 parameters for input filename and output filename.  That shell script works properly when i run it from a shell.

 

Here's the shell script

#!/bin/sh
whoami
date
echo about to: ffmpeg -i $1 -ar 22050 -ab 32k -r 25 -s 320x240 -vcodec flv -qscale 9.5 $2
#ffmpeg
ffmpeg -i $1 -ar 22050 -ab 32k -r 25 -s 320x240 -vcodec flv -qscale 9.5 $2
echo $?
whoami

(all but the big ffmpeg line is just debugging and curiousity)

 

when I run it from within my php page by doing:

echo exec( "danffmpeg  $cFileName  $cFLVName", &$aExecOutput, &$nExecReturn );

echo( "<BR>execoutput:<BR>\r\n" );
print_r( $aExecOutput );
echo( "<BR>execreturn:<BR>\r\n" );
print_r( $nExecReturn ); 

 

I get this output:

apache

 

execoutput: Array ( [0] => 0 [1] => apache [2] => Wed Aug 13 19:32:51 PDT 2008 [3] => about to: ffmpeg -i records/avitest_79.avi -ar 22050 -ab 32k -r 25 -s 320x240 -vcodec flv -qscale 9.5 streams/avitest_79.flv [4] => 1 [5] => apache )

 

execreturn: 0

 

The return value of ffmpeg within the script is 1, but the execreturn value of danffmpeg is 0.

 

When I change the line in the shell script that launches ffmpeg -- I uncomment the unadorned #ffmpeg and comment out the one that includes all the parameters and actually tries to do the conversion...

 

When I do that, ffmpeg runs.  I can see the huge long help screen output in the execoutput.  The $? return value of ffmpeg is still 1, and the execreturn value is still 0.

 

This leads me to believe it's not a permissions problem of launching ffmpeg.

My best guess is that it's not launching because of how much memory (or something) ffmpeg wants to take up when it tries to convert... and I tried setting memory_limit to 256M (from 16M) and it didn't change...

 

It's an x86_64 system running CentOS 5.  I've attached my phpinfo

 

Thank you again for your help

dan

 

 

 

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/119601-execd-ffmpeg-doesnt-really-run/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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