How to convert videos with ffmpeg

2020-02-16 03:25发布

问题:

I want to convert a video from one format to another using ffmpeg. I try lots of code but it does not convert the video.

For example:

exec("ffmpeg -i mickey.flv -ar 22050 -ab 32 -f avi -s 320x240 mickey.avi ");

This code does not convert the video, it does not show any error, it is loading continuously.

回答1:

It is impossible to pinpoint the problem, because you are executing an external application and any number of things could be going wrong in the process.

See this question for a number of very good hints to debug exec() commands.



回答2:

Display FFMPEG Error Output:

Command Line:

$command = "ffmpeg -i mickey.flv -ar 22050 -ab 32 -f avi -s 320x240 mickey.avi ";

exec($command . ' 2>&1', $output);

print_r($output);


标签: php ffmpeg