Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th July 2010, 13:22   #1  |  Link
nnezz
Registered User
 
Join Date: Jun 2008
Posts: 10
Encoding H.264 while preserving RGB colorspace / 4:4:4

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

(if I confused any terms, excuse me. I'm still learning)
nnezz is offline   Reply With Quote
Old 10th July 2010, 13:44   #2  |  Link
roozhou
Registered User
 
Join Date: Apr 2008
Posts: 1,181
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
roozhou is offline   Reply With Quote
Old 10th July 2010, 17:04   #3  |  Link
nnezz
Registered User
 
Join Date: Jun 2008
Posts: 10
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.
nnezz is offline   Reply With Quote
Old 10th July 2010, 17:23   #4  |  Link
J_Darnley
Registered User
 
J_Darnley's Avatar
 
Join Date: May 2006
Posts: 959
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)
__________________
x264 log explained || x264 deblocking how-to
preset -> tune -> user set options -> fast first pass -> profile -> level
Doom10 - Of course it's better, it's one more.
J_Darnley is offline   Reply With Quote
Old 10th July 2010, 18:49   #5  |  Link
nnezz
Registered User
 
Join Date: Jun 2008
Posts: 10
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?
nnezz is offline   Reply With Quote
Old 10th July 2010, 18:51   #6  |  Link
J_Darnley
Registered User
 
J_Darnley's Avatar
 
Join Date: May 2006
Posts: 959
play the avs file
__________________
x264 log explained || x264 deblocking how-to
preset -> tune -> user set options -> fast first pass -> profile -> level
Doom10 - Of course it's better, it's one more.
J_Darnley is offline   Reply With Quote
Old 10th July 2010, 20:16   #7  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,690
Dirac supports YCgCo, which can be losslessly converted back to RGB.
Dark Shikari is offline   Reply With Quote
Old 11th July 2010, 10:14   #8  |  Link
nnezz
Registered User
 
Join Date: Jun 2008
Posts: 10
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.
nnezz is offline   Reply With Quote
Old 13th July 2010, 20:37   #9  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: UK
Posts: 2,280
Use Cineform.

Andrew
kolak is offline   Reply With Quote
Old 13th July 2010, 20:44   #10  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,340
Yes, that's an excellent idea

CineForm is a badass codec, and can preserve 4:4:4 nicely.
Blue_MiSfit is offline   Reply With Quote
Old 14th July 2010, 00:31   #11  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: UK
Posts: 2,280
Quote:
Originally Posted by Blue_MiSfit View Post
Yes, that's an excellent idea

CineForm is a badass codec, and can preserve 4:4:4 nicely.
at 12bit
kolak is offline   Reply With Quote
Old 29th August 2017, 05:34   #12  |  Link
egr
Registered User
 
Join Date: Jan 2017
Posts: 12
Quote:
Originally Posted by nnezz View Post
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? Just wanna confirm...

Quote:
Originally Posted by kolak View Post
Use Cineform.

Andrew
Quote:
Originally Posted by kolak View Post
Quote:
Originally Posted by Blue_MiSfit View Post
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...
egr is offline   Reply With Quote
Old 29th August 2017, 07:49   #13  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 9,265
Cineform has been standardized as SMPTE VC-5, so even if GoPro shuts down their support, the standardized codec lives on.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is offline   Reply With Quote
Old 29th August 2017, 19:33   #14  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: UK
Posts: 2,280
Quote:
Originally Posted by egr View Post
I'm guessing this is no longer the case? Just wanna confirm...


Well it looks like they've closed up shop...
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
kolak is offline   Reply With Quote
Old 4th September 2017, 20:47   #15  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,340
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.
Blue_MiSfit is offline   Reply With Quote
Reply

Tags
h.264, rgb

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:34.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.