ffmpeg run from command line executes, from mod_fcgi truncates after completion

dollo2night

New Member
The ffmpeg from command line generates preview files and two separate two-pass conversion that when run from a shell script, execute successfully. Running the commands via php's exec(/usr/bin/ffmpeg) or through exec(name_of_shell_script) generates preview files successfully. THe strange behavior is that the movies will generate, then truncate. ffmpeg log files are generated successfully, the out put file I can watch grow in size as the conversion continues, and then, when complete it appears, the files are truncated.... The only things that have changed on the system are changing from mod_php to mod_fcgi and php_cgi, but the error logs show nothing unusual except for \[code\]mod_fcgid: stderr: wmv, files3/1qwj, 1qwj.wmv\[/code\]supressing output of the shell \[code\]scriptname.sh > /dev/null 2>&1\[/code\]does not change the outcome. should shell_exec be used? Is it a unix permissioning?This is in ubuntu 10.04.1This solution doesn't applyhttp://stackoverflow.com/questions/2504842/ffmpeg-running-in-command-line-but-not-phpEDIT:looks like it might have something to do with the two pass encoding. The two pass encoding works fine from command line, but from the PHP env the shell overwrites something on the second pass. \[code\]nice -n 11 /usr/bin/ffmpeg -y -i $1 -r 30000/1001 -b 1M -bt 2M -vcodec libx264 -threads 0 -pass 1 -vpre /usr/share/ffmpeg/libx264-fastfirstpass.ffpreset -an movie.flv nice -n 11 /usr/bin/ffmpeg -y -i $1 -r 30000/1001 -b 1M -bt 2M -vcodec libx264 -threads 0 -pass 2 -vpre /usr/share/ffmpeg/libx264-hq.ffpreset -acodec libfaac -ac 2 -ar 48000 -ab 192k movie.flv \[/code\]$1 is the input filenamefound https://roundup.ffmpeg.org/issue1829
 
Back
Top