0

I have noticed that some apps (namely Firefox and, in default configuration, mpv) save snapshots of MP4 videos in JPEG format. Is this because individual frames can be losslessly extracted as JPEGs or just an arbitrary choice?

Sorry if this is the wrong site to ask questions like that, but I have glanced over the list of StackExchange sites and haven't noticed anything more relevant.

2
  • Probably arbitrary but working under the assumption that the level of noise in the video stream would make any lossless algorithm ineffective (large images) and irrelevant due to the fact that it has lossy compression noise to begin with making a lossless output a bit pointless.
    – Mokubai
    Sep 25, 2019 at 15:32
  • 1
    H.264 (AVC) compression is lossy, and typical JPEG compression is lossy. I don't see anything lossless going on here, so I'm wondering if I don't understand the question.
    – Spiff
    Sep 25, 2019 at 16:05

1 Answer 1

1

No, H.264 (AVC) is generally lossy, and JPEG is also generally lossy. There's nothing lossless going on here. The tools you mention probably use JPEG because it's the most universal format for still raster (i.e. non-vector) images.

In contrast, if H.265 (HEVC) frame capture tools default to saving still frames as HEIF/HEIC, it's because the video format and the still format were developed together and share a lot in common.

3
  • Likewise if the video were mjpeg then you could potentially grab frames as jpeg images. H.264 is another beast entirely.
    – Mokubai
    Sep 25, 2019 at 21:41
  • @Spiff What I meant by lossless is that a frame can be reconstructed in JPEG out of H.264 stream without getting additional loss somehow (just like in your H.265 → HEIF example). This was a wild guess but still I was really curious. Thank you for a thorough explanation :)
    – Ale
    Sep 25, 2019 at 23:36
  • I've done some more research and the closest to being JPEG-based is apparently the MPEG-1 encoding, where I-frames are “similar to baseline […] JPEG pictures” (see web.archive.org/web/20080616113041/http://bmrc.berkeley.edu/…; although this still isn't 100% JPEG). H.264 has indeed come a long road since then (e. g. there are no I-frames anymore, the encoding operates on slices of frames now).
    – Ale
    Sep 25, 2019 at 23:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .