我正在尝试使用以下方法将yuv文件转换为mp4:
ffmpeg -f rawvideo -vcodec rawvideo -s 1920x1080 -r 25 -pix_fmt yuv420p -i inputfile.yuv -c:v libx264 -preset ultrafast -qp 0 output.mp4
但是我收到了以下错误:
[rawvideo @ 0000023f70bf8d20] Invalid buffer size, packet size 2649600 < expected frame_size 3110400
Error while decoding stream #0:0: Invalid argument
frame= 251 fps= 22 q=-1.0 Lsize= 373766kB time=00:00:10.00 bitrate=306186.8kbits/s speed=0.861x
video:373763kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000738%
[libx264 @ 0000023f70bfaae0] frame I:2 Avg QP: 0.00 size:1412854
[libx264 @ 0000023f70bfaae0] frame P:249 Avg QP: 0.00 size:1525733
[libx264 @ 0000023f70bfaae0] mb I I16..4: 100.0% 0.0% 0.0%
[libx264 @ 0000023f70bfaae0] mb P I16..4: 57.0% 0.0% 0.0% P16..4: 43.0% 0.0% 0.0% 0.0% 0.0% skip: 0.0%
[libx264 @ 0000023f70bfaae0] coded y,uvDC,uvAC intra: 100.0% 100.0% 100.0% inter: 100.0% 100.0% 100.0%
[libx264 @ 0000023f70bfaae0] i16 v,h,dc,p: 45% 52% 3% 0%
[libx264 @ 0000023f70bfaae0] i8c dc,h,v,p: 1% 90% 9% 0%
[libx264 @ 0000023f70bfaae0] kb/s:304966.66