title: MJPEG vs. MPEG-4 encoding time
body: <p>I am testing the encoding performance (MPEG-4 and MJPEG) of a smart camera. I have written an application in OpenCV/FFMPEG for performing encoding, where the application captures images from the camera and encodes them to a desired encoding format. In the benchmarks, I came to know that MJPEG encoding is taking much longer than MPEG-4 encoding. I expected it to be other way around. Encoding a single frame to MPEG-4 takes around 31ms, whereas encoding to MJPEG takes around 80ms. Does MJPEG really takes such a long time in comparison to MPEG-4? </p>