I use the following FFmpeg command to encode the well-known
Akiyo sequence from raw `y4m` format with H.264:
Code:
ffmpeg -f rawvideo -pix_fmt yuv420p -s:v 352x288 -r 30 -i akiyo_cif.y4m -c:v libx264 akiyo_cif.mp4
However, the encoded video I get is distorted, i.e. there is horizontal panning/sliding of frames and the colors are not accurate. FFmpeg yields the following error:
Code:
[rawvideo @ 0x7f5e7c57b140] Invalid buffer size, packet size 1844 < expected frame_size 152064
Error while decoding stream #0:0: Invalid argument
I don't understand the error. I provided the CIF resolution (352x288) and frame rate (30 fps) as input, so there shouldn't be anything wrong with those. What could be the source of this problem?