Encode video in three different formats using ffmpeg at the click of a button

I am facing the problem of converting / encoding any video to three ie formats; webm, mp4 and flv when downloading videos at the click of a button. But the problem is that some videos are converted and some or not. Example, when I try to convert mp4 to flv, some mp4 videos get converted and some don't. I am using this command to convert it. I've tried other commands as well, but this one works for a few mp4 files that others don't work for any file. Here is the command

ffmpeg -i input.mp4 -c:v libx264 -crf 28 output.flv

      

which is exactly like this i put in php code

passthru("ffmpeg -i input.mp4 -c:v libx264 -crf 28 output.flv")

      

I am also having problems converting avi and ogg files to mp4, webm and flv. this is really weird. Please, help.

thank

+3


source to share


1 answer


you did not specify the acodec parameter

ffmpeg -i input.mp4 -acodec libvo_aacenc -vcodec libx264 -crf 28 output.flv

      



Even if it doesn't help you check the error, it will always tell you what to add.

0


source







All Articles