如何使用ffmpeg将图像序列化为视频?

时间:2019-07-31 11:05:57

标签: android ffmpeg

打开输出流#0:0的编码器时出错-可能是不正确的参数,例如bit_rate,rate,width或height

命令: execFFmpegBinary(new String [] {“-y”,“ -r”,“ 11/2”,“ -i”,inputImages,“ -vcodec”,“ libx264”,“ -pix_fmt”,“ yuv420p”,“-预设”,“超快速”,outputpath});

1 个答案:

答案 0 :(得分:0)

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

错误自我表示诸如比特率和高度宽度之类的参数不正确。 在大多数情况下,高度和宽度是错误的。检查inputImages张图片的宽度和高度。高度或宽度可能很奇怪,因此FFmpeg会抛出此错误

尝试以下代码

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

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