[Libav-user] MJPEG Encoding blocky output after a few frames

Tobias Coni tobias.coni at gmail.com
Tue Jul 4 21:06:00 EEST 2023


I'm encoding MJPEG. For the first few frames, everything is fine. But after
~10 Frames the MJPEG output starts to show some blockiness. Also the output
size is getting smaller.

I have created a proof of concept based on the encode_video.c sample code.

Here is my code: https://paste.debian.net/1284938/

Just build and run it with a command like this. It then creates 25 JPEG
files: gcc encode_video.c -o encode_video `pkg-config --cflags --libs
libavformat libavcodec libswresample libswscale libavutil` && ./encode_video

Here is a picture where the blockiness is visible (file 24 from my code):

Any idea what could cause this?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20230704/1b88a090/attachment.htm>

More information about the Libav-user mailing list