upvote
FYI, both VP9 and AV1 support lossless as part of their base profiles, so lossless files using those codecs should be compatible with all implementations (at least in theory). Though those profiles only support 4:2:0, so it depends on your use case if that really counts as lossless.
reply
I struggle to think of a situation where the blur of chroma subsampling is acceptable but very high quality or prores isn't good enough, I need lossless.
reply
4:2:0 is not lossless. 4:4:4 with quantizing down to 8-bit YCbCr isn't lossless either. But 10-bit 4:4:4 is reversible back to 8-bit RGB without loss.
reply
There's a distinction to be made between lossless (compression) and lossless (bit depth/gamma/yadda yadda); typically the format conversion isn't considered part of the "lossy/lossless" distinction.

Definitely not something to be forgotten if you're expecting to compress lossless RGB, although this is pretty rare outside of niche-ish use cases (afaik game capture is basically the only place where people are likely to be using RGB and not YCbCr? could be wrong!)

reply
Also (if you round correctly) there is no generation loss in the format conversion. You can round-trip between them as many times as you want and you only get the loss of the initial RGB->YCbCr.
reply
Animation production (2D or 3D) can also have raw RGB frames.
reply
Ah, I hadn't considered that but that totally makes sense!
reply
What is the purpose of lossless H.264 vs. ProRes or the like?

Is it similar to lossless audio were there's not a ton of optimization you can do?

reply
I've attempted to get researchers to use lossless H.264 to encode CT scans. They typically use directories full of tiffs. Even with intra-slice compression (i.e. tiff compression) they are pretty huge. But H.264 will let you recover the original images to the individual bit, and save a huge amount of space thanks to inter-slice similarities.

They are still using directories of tiff, though.

reply
I’d imagine the main drawback of using H.264 here is that you’d still have to decode to get the frames back. This is similar to how even though many consumer grade cameras will output natively to h.264, if you want to edit the videos from it you’d usually have to convert it to prores or something first (the editor would usually do this automatically behind the scenes)

I’m not sure if lossless h.264 is I only or not, but if it uses inter-frame compression then it’s difficult to randomly access arbitrary frames. For any arbitrary frame you’d have to find the nearest key frame, then interpolate from there based on the inter-frame compression metadata.

reply
It's acceptable to use the nearest key frame when randomly accessing arbitrary frames.

The real problem is that you'd have to rewrite the entire app stack to use H.264 or AV1 for storing the image stack generated by CT.

CT images are 16-bit monochrome, and the pixel values have real physical meaning (Hounsfield Units). So you'd have to prove that your compression tool can reproduce the original images 1:1. The H.264 encoder would also need to be modified to support 16-bit pixels.

And you'd need to modify the post-processing tools to accept your new file format. Otherwise users will still have to convert it back to DICOM or some other commonly accepted format before they can use their post-processing software.

So unless you're a CT vendor, you'll have a hard time pushing this into a hospital.

reply
Lots of hardware requires specifically h.264 as a transit; many of the MPEG standards are built around it. So this lets you get MPEG-PS, or lossless BDs, or some hardware/specialized software decoders for machines that otherwise couldn’t keep up (like set top boxes).
reply
prores is not lossless. It's also an intraframe codec so compression is not great.
reply
It depends what you mean by "not great". Prores's compression is far better than say H.264, if you actually want usable footage for editing.
reply
x265 supports lossless as well (though I believe it's not part of the H.265 standard). It's what I use for video capture.
reply
you can easily record lossless h264 via obs and any ffmpeg-backed player will play it just fine

the days where the OS matters for video playback are long gone

reply