Log in

View Full Version : Encoding H.264 while preserving RGB colorspace / 4:4:4


nnezz
10th July 2010, 13:22
I have pure RGB video, mostly CGI type footage, that I wish to encode in H.264 while preserving the full 4:4:4 chroma.
From what I can read, the specification supports it via the H.264/AVC High 4:4:4 Intra/Predictive profiles.
But, I can't find any information on how to use this or which applications/encoders support it.

x264 won't take anything but yv12, so where do I go to encode in the full RGB colorspace?
I realize that RGB encoding currently is (much) less efficient than YV12, but I can live with that, as long as I'm able to do it :)

Please, any help on the subject is greatly appreciated.

Reference: High-Fidelity RGB Video Coding Using Adaptive Inter-Plane Weighted Prediction (http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?reload=true&arnumber=4811977)

(if I confused any terms, excuse me. I'm still learning)

roozhou
10th July 2010, 13:44
seperate RGB to 3 channels and encode to 3 AVC streams
for each stream:
assume R/G/B to be Y, and set each pixel in U & V to 128

nnezz
10th July 2010, 17:04
If I understand right, the idea is to separate each color channel (via avisynth?) treating each R/G/B as luminance while neutralizing the chroma. Then feed each luminance plane into x264 at the same time to produce a final encode?
Although it sounds more like you're saying I have to encode each stream separately, but if I do that then how do I combine the three channels afterwards to make a watchable final file?

I'm a little confused. Please be kind and elaborate a tiny bit on which app I should use for each step.

J_Darnley
10th July 2010, 17:23
Avisynth will do both processing steps for you.

For splitting use: ShowRed("yv12"), ShowGreen("yv12") and ShowBlue("yv12")
Re-combining: MergeRGB(red_clip, green_clip, blue_clip)

nnezz
10th July 2010, 18:49
I encoded each stream and got 3 very large files. The same 355MB 10 second file which ordinarily compresses neatly to 24MB, turned into 3 large streams each about 70MB, each encoded much slower than usual as well, using the same compression profile. Does this seem right?

Now that it's done, I can feed the files back into avisynth using the MergeRGB command, but how do I get the resulting output into a watchable file without re-encoding?

J_Darnley
10th July 2010, 18:51
play the avs file

Dark Shikari
10th July 2010, 20:16
Dirac supports YCgCo, which can be losslessly converted back to RGB.

nnezz
11th July 2010, 10:14
I've found a few other forum posts both here and other places on the web, and it seems that encoding in h.264 without chroma subsampling isn't possible atm. Maybe some day :)

Thanks for all your answers.

kolak
13th July 2010, 20:37
Use Cineform.

Andrew

Blue_MiSfit
13th July 2010, 20:44
Yes, that's an excellent idea :)

CineForm is a badass codec, and can preserve 4:4:4 nicely.

kolak
14th July 2010, 00:31
Yes, that's an excellent idea :)

CineForm is a badass codec, and can preserve 4:4:4 nicely.

at 12bit :)

egr
29th August 2017, 05:34
I've found a few other forum posts both here and other places on the web, and it seems that encoding in h.264 without chroma subsampling isn't possible atm. Maybe some day :)

Thanks for all your answers.I'm guessing this is no longer the case (https://forum.doom9.org/showthread.php?p=1545751#post1545751)? Just wanna confirm...

Use Cineform.

Andrew

Yes, that's an excellent idea :)

CineForm is a badass codec, and can preserve 4:4:4 nicely.
at 12bit :)

Well it looks like they've closed up shop (http://cineform.com/)...

nevcairiel
29th August 2017, 07:49
Cineform has been standardized as SMPTE VC-5, so even if GoPro shuts down their support, the standardized codec lives on.

kolak
29th August 2017, 19:33
I'm guessing this is no longer the case (https://forum.doom9.org/showthread.php?p=1545751#post1545751)? Just wanna confirm...


Well it looks like they've closed up shop (http://cineform.com/)...

codecs is still very alive and now it's actually free.
Adobe, Resolve, Scratch all have native support now.

If you want o build own encoder for example you can drop line here and get your own SDK license key (if they decide it's worth it):
https://gopro.com/connect#cineform

Blue_MiSfit
4th September 2017, 20:47
Cineform lives on :) It's still quite good and flexible.

x264 can do 4:4:4 encoding now, and 10 bit as well, but I'm not aware of any hardware decoder support whatsoever.