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 18th June 2013, 00:52   #1  |  Link
pancserzso
Registered User
 
Join Date: Oct 2004
Posts: 131
Is H.264/RGB playback generally supported?

I'm trying to convert an RGB image sequence to H.264, using x264.

My problem is that with any RGB->YUV conversion, colors change, and it's sometimes quite visible (especially on bright colors near the edges). Is there anything I can do with this without using RGB colorspace for encoding?

Do colors look a bit pale on all equipment, even on say high-end blu-ray players and projectors, or only on computer monitors working in RGB space?

My other question is that if I use `--output-csp rgb` with x264, which works wonderfully, but generates 2x size files, what are the limitations?

Is it possible to playback RGB H.264 files on any equipment, or only on PCs? LAV filters fall back to avcodec, but plays back the files fine. Is this generally supported on all software players, or it's more of an experimental feature?
pancserzso is offline   Reply With Quote
Old 18th June 2013, 04:04   #2  |  Link
vivan
/人 ◕ ‿‿ ◕ 人\
 
Join Date: May 2011
Location: Russia
Posts: 643
Quote:
Originally Posted by pancserzso View Post
My problem is that with any RGB->YUV conversion, colors change, and it's sometimes quite visible (especially on bright colors near the edges). Is there anything I can do with this without using RGB colorspace for encoding?
Yes. The problem is, x264 always uses Rec601 for RGB -> YUV conversion, but for HD videos players use Rec709 for converting YUV back to RGB. That leads to slightly wrong colors.
You'll need to use Avisynth for correct RGB -> YUV conversion (using Rec709 matrix). Use this function:
Code:
ConvertToYV12 (matrix = "Rec709")
Quote:
Originally Posted by pancserzso View Post
My other question is that if I use `--output-csp rgb` with x264, which works wonderfully, but generates 2x size files, what are the limitations?

Is it possible to playback RGB H.264 files on any equipment, or only on PCs? LAV filters fall back to avcodec, but plays back the files fine. Is this generally supported on all software players, or it's more of an experimental feature?
No, only some software players (on PC) support this. And there's no hardware players with support of such files.
vivan is offline   Reply With Quote
Old 18th June 2013, 04:59   #3  |  Link
pancserzso
Registered User
 
Join Date: Oct 2004
Posts: 131
Quote:
Originally Posted by vivan View Post
Yes. The problem is, x264 always uses Rec601 for RGB -> YUV conversion, but for HD videos players use Rec709 for converting YUV back to RGB. That leads to slightly wrong colors.
You'll need to use Avisynth for correct RGB -> YUV conversion (using Rec709 matrix). Use this function:
Code:
ConvertToYV12 (matrix = "Rec709")
Thanks! I tried that conversion, however I ended up with 4 different images and thus I started a separate thread:
http://forum.doom9.org/showthread.php?p=1633296#post1633296

OK, so this RGB encoding is a strictly PC only thing! Nice to know! So if both the source material is from PC and the destination is a PC, is this workflow considered to be the highest possible quality (in 8-bit)?

Last edited by pancserzso; 18th June 2013 at 05:06.
pancserzso is offline   Reply With Quote
Old 18th June 2013, 05:50   #4  |  Link
vivan
/人 ◕ ‿‿ ◕ 人\
 
Join Date: May 2011
Location: Russia
Posts: 643
Quote:
Originally Posted by pancserzso View Post
OK, so this RGB encoding is a strictly PC only thing! Nice to know! So if both the source material is from PC and the destination is a PC, is this workflow considered to be the highest possible quality (in 8-bit)?
Well... kind of. x264 RGB encoding isn't as effective as YV12/YV24. You can try using pc-range YV24:
- in avisynth use ConvertToYV24 (matrix = "PC.709")
- for x264 add --input-range PC --output-csp i444
It's a bit less compatible, though (all renderers support rgb, but not all - YV24).
vivan is offline   Reply With Quote
Old 18th June 2013, 15:06   #5  |  Link
pancserzso
Registered User
 
Join Date: Oct 2004
Posts: 131
Quote:
Originally Posted by vivan View Post
Well... kind of. x264 RGB encoding isn't as effective as YV12/YV24. You can try using pc-range YV24:
- in avisynth use ConvertToYV24 (matrix = "PC.709")
- for x264 add --input-range PC --output-csp i444
It's a bit less compatible, though (all renderers support rgb, but not all - YV24).
Thanks for this, it's amazingly more efficient! It takes only 10% more compared to YV12! RGB takes 130% more compared to YV12!

Small questions:
1. What is the difference between i444 and yv24 in x264? Shouldn't I use yv24 as it's supported by x264 --fullhelp?

2. Should I use the options --colorprim --transfer --colormatrix --range?

3. What is the difference between --range and --input-range and --input-csp and --output-csp? Are they the same usually?
pancserzso is offline   Reply With Quote
Old 18th June 2013, 16:55   #6  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Quote:
Originally Posted by pancserzso View Post
3. What is the difference between --range and --input-range and --input-csp and --output-csp? Are they the same usually?
--input-range is the .. input range.
--range is the output range. (if input and output range differ, x264 will do a conversion.)
--input-csp is the input color space (without range or matrix info)
--output-csp is the output color space (without range or matrix info, if input and output csp differ x264 will do a conversion.)

Note that x264 defaults to --output-csp i420. --range will to default to the input-range.

Last edited by sneaker_ger; 18th June 2013 at 17:35.
sneaker_ger is offline   Reply With Quote
Reply

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:03.


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