0
votes

Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

Command: execFFmpegBinary(new String[]{"-y", "-r", "11/2", "-i", inputImages, "-vcodec", "libx264", "-pix_fmt", "yuv420p", "-preset", "ultrafast", outputpath});

1
Show the complete log from the ffmpeg command so we can see the exact problem. Otherwise we can only guess.llogan

1 Answers

0
votes
#0:0 - may be incorrect parameters such as bit_rate, rate, width or height

error self indicates that parameters like bitrate rate and height width are incorrect. in most of the cases, height and width are wrong. check your width, height of inputImages images. Height or Width may be odd so FFmpeg throw this error

try below code

execFFmpegBinary(new String[]{"-y", "-r", "11/2", "-i", inputImages, "-filter_complex","scale=iw:-2","-vcodec", "libx264", "-pix_fmt", "yuv420p", "-preset", "ultrafast", outputpath});

or

   execFFmpegBinary(new String[]{"-y", "-r", "11/2", "-i", inputImages, "-filter_complex","scale=-2:ih","-vcodec", "libx264", "-pix_fmt", "yuv420p", "-preset", "ultrafast", outputpath});