-1

I have read this Create Video using ffmpeg

Stack Question for the Same

Wiki Page for the same

Still I am not able to get it. I have written this shell command in PHP

echo $make_movie = "$ffmpeg -framerate 1/5 -i $folder_name/img%03d.png -c:v libx264 -r 25 -pix_fmt yuv420p $folder_name/output.mp4";

This gives output

ffmpeg\bin\ffmpeg.exe -framerate 1/5 -i ankit/img%03d.png -c:v libx264 -r 25 -pix_fmt yuv420p ankit/output.mp4

if(shell_exec($make_movie)){
    echo "<br />Movie Created..<br />";
}
else{
    echo "<br />Movie Creation Error..<br />";
}

The Output is Movie Creation Error that means the Shell Command is not executing?

Questions:

  1. What is wrong?
  2. For future use, any debugging methods for this?

I ran the same command on cmd and it made the video..!!!

Community
  • 1
  • 1
Knight Rider
  • 186
  • 10

1 Answers1

1

shell_exec is pretty useless when it comes to figuring out why your command failed. use exec() instead:

$last_line = exec($make_movie, $all_output, $exit_code);
var_dump($exit_code);

You'll have to look at ffmpeg's docs to determine what the exit code means

Marc B
  • 356,200
  • 43
  • 426
  • 500