What is an MJPEG File?
MJPEG (Motion JPEG) is a video format in which every frame is compressed separately as a JPEG image. Because nothing is shared between frames, MJPEG files are much larger than modern video, but every frame is a complete picture, which makes the format simple to decode, easy to edit frame by frame and quick to start. It is widely used by IP security cameras, webcams and some digital cameras.
A .mjpeg (or .mjpg) file is usually a raw stream: JPEG images placed one after another with no container, so it stores no frame rate, timestamps or audio. MJPEG video can also be stored inside containers such as AVI and MOV, which add timing and sound. IP cameras often stream MJPEG over HTTP as multipart/x-mixed-replace, which browsers can show in an <img> tag.
Download MJPEG Sample Files
Below are six raw MJPEG streams from 360p to 1440p. None of them contain audio, because a raw MJPEG stream cannot carry sound.
MJPEG Sample File Details
| Sample | Resolution | Frames | Average frame | File size |
|---|---|---|---|---|
| 636×360 | 636 × 360 | 1,344 | 8.6 KB | 11.3 MB |
| 850×480 | 850 × 480 | 1,344 | 14.2 KB | 18.6 MB |
| 1280×720 | 1280 × 720 | 1,344 | 28.8 KB | 37.8 MB |
| 1920×1080 | 1920 × 1080 | 1,344 | 59.2 KB | 77.6 MB |
| 2560×1440 | 2560 × 1440 | 1,344 | 97.8 KB | 128 MB |
| 1280×720 High Quality | 1280 × 720 | 1,167 | 92.2 KB | 105 MB |
Every frame is a baseline 8-bit JPEG with 4:2:0 chroma subsampling. 1,344 frames make 53.76 seconds at 25 fps, the frame rate of the source clip; the files themselves do not store a frame rate. The high-quality 720p sample is a different 1,167-frame clip whose frames are about three times larger.
What You Can Test With These MJPEG Files
- Players and decoders: software that has to play a stream with no stored frame rate.
- Frame extraction: every frame is a complete JPEG, so frames can be cut out without re-encoding.
- Camera and streaming pipelines: the same format IP cameras and webcams produce.
- Large files and bandwidth: uploads, downloads and storage with files up to 128 MB.
- Quality comparisons: the same resolution at two JPEG quality levels (720p and 720p High Quality).
How to Play or Convert an MJPEG File
# Play the raw stream at 25 frames per second
ffplay -f mjpeg -framerate 25 sample-360p.mjpeg
# Convert to an MP4 (H.264) video
ffmpeg -framerate 25 -i sample-360p.mjpeg -c:v libx264 -pix_fmt yuv420p sample.mp4
# Save every frame as a JPEG image
ffmpeg -i sample-360p.mjpeg frame_%04d.jpg
VLC media player can also open MJPEG files directly.
MJPEG vs Other Video Formats
| Format | Compression | File size | Typical use |
|---|---|---|---|
| MJPEG | Each frame on its own | Very large | Security cameras, webcams, frame-accurate editing |
| MP4 (H.264) | Between frames | Small | Streaming and sharing |
| WEBM | Between frames (VP8, VP9, AV1) | Small | Web video |
| AVI | Depends on the codec inside, often MJPEG | Varies | Older Windows video and cameras |






