View Full Version : lossless x264 in 4:2:0?
Thunderbolt8
1st June 2017, 19:08
Is it possible to get lossless encoding with x264 in 4:2:0? Using MeGUI, when I set crf=0 then I automatically get a file in 4:4:4. With crf=1 it's still in 4:2:0.
sneaker_ger
1st June 2017, 19:12
Yes, it's possible. Probably that's already what's happening. The profile is called "High 4:4:4 Predictive" but it also supports 4:2:0. MediaInfo should show the distinction between the profile name and the actual subsampling.
LoRd_MuldeR
1st June 2017, 19:18
Lossless x264 uses/requires the "High 4:4:4 Predictive" (High 4:4:4) Profile. That's because the "Predictive Lossless Coding" feature, which x264 uses in lossless mode, is allowed in "High 4:4:4" Profile only:
https://de.wikipedia.org/wiki/H.264#Profile
That this profile also allows the "4:4:4" chroma format is a coincidence. It doesn't mean the that content necessarily needs to be in the "4:4:4" chroma format ;)
Thunderbolt8
1st June 2017, 19:26
well, for some reason my TV does not like the lossless files produced by x264. It plays stuff with CRF=1 fine despite e.g. the bitrate is also very high then. So I guess this cannot be the limitation. My TV also plays lossless x265 fine, apparently because it still is 4:2:0. but encoding x265 losslessly is too slow for me.
So there is a way to get x264 lossless mode to be in 4:2:0? If so, how?
sneaker_ger
1st June 2017, 19:32
Like we said: it already is. No special setting required. Did you look at MediaInfo like I said? If your TV does not support the lossless profile that's just the way it is. Can't be helped.
LoRd_MuldeR
1st June 2017, 19:33
Support for "Predictive Lossless Coding" (or "High 4:4:4 Predictive" profile in general) is pretty much non-existent in consumer-grade hardware decoders :scared:
You can not get "lossless" mode, as it has been implemented in x264, without "High 4:4:4 Predictive" profile. x264, in lossless mode, uses "Predictive Lossless Coding", which unavoidably bumps the profile requirement to "High 4:4:4 Predictive".
Even if x264 would falsely declare the "lossless" stream as some lower profile than "High 4:4:4 Predictive", the stream would still use "Predictive Lossless Coding" and thus it still would require a decoder capable of "Predictive Lossless Coding"...
(Also, while "crf=1" is not "true" lossless, in the mathematical sense, I very much doubt that you, or anybody, can actually see a difference between "crf=1" and "true" lossless)
kabelbrand
1st June 2017, 19:34
Your TV does support High profile but not High 4:4:4. Just stick to a visually lossless CRF 1 if you are aiming for device compatibility.
benwaggoner
1st June 2017, 21:59
Your TV does support High profile but not High 4:4:4. Just stick to a visually lossless CRF 1 if you are aiming for device compatibility.
Plus setting --vbv-bufsize and --vbv-maxrate to the appropriate max values for your Profile @ Level. CRF 1 can easily get too big for a compliant decoder to handle well.
HEVC does a lot better with the "nearly lossless" case as lossless coding units and transform skip are available in Main Profile. So you can get lossless frames or parts of a frame when RDO pays off ad VBV allows.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.