burningdan Posted August 14, 2008 Share Posted August 14, 2008 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 More sharing options...
trq Posted August 14, 2008 Share Posted August 14, 2008 Does the apache user have permssions to to write to the location your trying to write the output file to? Link to comment https://forums.phpfreaks.com/topic/119601-execd-ffmpeg-doesnt-really-run/#findComment-616229 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.