HuffYUV RGB->YUY2 conversion: TV/PC scale?
- Scintilla
- (for EXTREME)
- Joined: Mon Mar 31, 2003 8:47 pm
- Status: Quo
- Location: New Jersey
- Contact:
HuffYUV RGB->YUY2 conversion: TV/PC scale?
Does anybody know whether, when using HuffYUV's "Convert to YUY2" option for RGB input, the conversion that occurs produces PC scale or TV scale luma?
I just realized this working on my last video, when I was informed that I had (incorrectly) encoded my MPEG-2 with PC-scale luma.
My typical workflow's RGB<->YUV conversions are as follows:
- YV12 off the VOB, served straight through AVISynth, then somehow converted to RGB for use in Premiere Pro (I do not explicitly call ConvertToRGB32() in my scripts). I'm assuming that this conversion assumes TV-scale YUV input, as this is the default behaviour in AVISynth.
- RGB video in Premiere Pro, saved as YUY2 HuffYUV. If I would just save my exports in RGB mode, I could spare myself this trouble, but it would results in significantly bigger files.
TMPGEnc has an option for "Output YUV data as Basic YCbCr not CCIR601" (PC-scale luma), and I had originally had this checked; I only unchecked it after being informed that I was doing it wrong. But, if it turns out that HuffYUV's RGB->YUV conversion maps it to TV scale already, wouldn't it be better to check this option so as not to shrink the luma range twice?
That's why I'm hoping somebody knows the answer here. As far as I can see, it's not in the HuffYUV documentation.
I just realized this working on my last video, when I was informed that I had (incorrectly) encoded my MPEG-2 with PC-scale luma.
My typical workflow's RGB<->YUV conversions are as follows:
- YV12 off the VOB, served straight through AVISynth, then somehow converted to RGB for use in Premiere Pro (I do not explicitly call ConvertToRGB32() in my scripts). I'm assuming that this conversion assumes TV-scale YUV input, as this is the default behaviour in AVISynth.
- RGB video in Premiere Pro, saved as YUY2 HuffYUV. If I would just save my exports in RGB mode, I could spare myself this trouble, but it would results in significantly bigger files.
TMPGEnc has an option for "Output YUV data as Basic YCbCr not CCIR601" (PC-scale luma), and I had originally had this checked; I only unchecked it after being informed that I was doing it wrong. But, if it turns out that HuffYUV's RGB->YUV conversion maps it to TV scale already, wouldn't it be better to check this option so as not to shrink the luma range twice?
That's why I'm hoping somebody knows the answer here. As far as I can see, it's not in the HuffYUV documentation.
-
- Joined: Tue Dec 25, 2007 8:26 am
- Status: better than you
- Contact:
Re: HuffYUV RGB->YUY2 conversion: TV/PC scale?
Why are you using YUY2? Which huffyuv encoder are you using? Why are you letting the encoder do colourspace conversions instead of doing them with the correct matrix in avisynth?
- Scintilla
- (for EXTREME)
- Joined: Mon Mar 31, 2003 8:47 pm
- Status: Quo
- Location: New Jersey
- Contact:
Re: HuffYUV RGB->YUY2 conversion: TV/PC scale?
I'm using YUY2 because it saves disk space vs the RGB modes available, I'm using HuffYUV 2.1.1, and see answer #1.
And even if it turns out that HuffYUV uses the PC scale matrix, I can just let TMPGEnc do the mapping to CCIR601 for my convention encodes and keep all my other (distribution) encodes at PC scale.
Incidentally, once I get this figured out, I guess I'll be able to stop using white mattes in Premiere that are really (235, 235, 235), like I've been doing for years, instead of FFFFFF.
And even if it turns out that HuffYUV uses the PC scale matrix, I can just let TMPGEnc do the mapping to CCIR601 for my convention encodes and keep all my other (distribution) encodes at PC scale.
Incidentally, once I get this figured out, I guess I'll be able to stop using white mattes in Premiere that are really (235, 235, 235), like I've been doing for years, instead of FFFFFF.
-
- Joined: Tue Dec 25, 2007 8:26 am
- Status: better than you
- Contact:
Re: HuffYUV RGB->YUY2 conversion: TV/PC scale?
May as well use YV12, it's easier to work with. Use avisynth for correct colour coefficients. As far as whether it uses PC or TV, I would stick to using ffmpeg for exact and confirmed accuracy but it seems HuffYUV 2.1.1 uses whatever your source is, and when it cannot tell it uses PC scale. Still best to use ffmpeg's implementation for confirmed accuracy. I don't understand why people use other encoders when lavc is the best for most things anyway, or otherwise links with the best like in the case of x264. All your anime sources uses TV scale so I don't see why you'd corrupt it by changing to PC for distribution encodes. Seems like this is another case of amvers doing things the dumb/incorrect way.
- mirkosp
- The Absolute Mudman
- Joined: Mon Apr 24, 2006 6:24 am
- Status: (」・ワ・)」(⊃・ワ・)⊃
- Location: Gallarate (VA), Italy
- Contact:
Re: HuffYUV RGB->YUY2 conversion: TV/PC scale?
Blame it on most NLEs available, really. I don't think there even is an option to pick between TV and PC scale in Premiere/After Effects/Vegas/Magix/Avid/What-have-you. This is why we need a proper GUI for avs-based editing... so we can get things right. And for free. >_>Mister Hatt wrote:Seems like this is another case of amvers doing things the dumb/incorrect way.
-
- Joined: Tue Dec 25, 2007 8:26 am
- Status: better than you
- Contact:
Re: HuffYUV RGB->YUY2 conversion: TV/PC scale?
A GUI for avs is a really dumb idea, would be hideously slow, and eat insane amounts of memory. What you need is to clip your shit to lossless and leave it as is. If you don't have HDD space, then do it in smaller bits or something. Otherwise, maybe use low quality vid and then apply the process you've setup in your NLE to lossless vid later on or something. Not sure how many low-end NLEs do that though. Point is, there is no need to pick between PC and TV when all the source material is TV anyway.
- mirkosp
- The Absolute Mudman
- Joined: Mon Apr 24, 2006 6:24 am
- Status: (」・ワ・)」(⊃・ワ・)⊃
- Location: Gallarate (VA), Italy
- Contact:
Re: HuffYUV RGB->YUY2 conversion: TV/PC scale?
The problems kick in when you produce effects like particles or start to also use fanarts or stuff like those. Fanarts are PC levels, and of course you can't tell after effects or premiere to make something tv levels (closest you can do is if you're doing a solid like Scintilla was explaining, but with the more complex stuff it's not quite as simple ─ if possible at all).Mister Hatt wrote:Point is, there is no need to pick between PC and TV when all the source material is TV anyway.
- Scintilla
- (for EXTREME)
- Joined: Mon Mar 31, 2003 8:47 pm
- Status: Quo
- Location: New Jersey
- Contact:
Re: HuffYUV RGB->YUY2 conversion: TV/PC scale?
My build of HuffYUV doesn't have a YV12 mode, it doesn't bother me.
If we can assume that most viewers will watch distro encodes on their computer monitors and not on TV sets or projectors, then wouldn't PC scale luma make more sense for such encodes, for to take advantage of the full range possible on a monitor?
You mentioned ffmpeg; I do have ffdshow, the 6/6/2009 build to be exact, and it does offer HuffYUV encoding in YV12. No option for luma scale though as far as I can see.
If we can assume that most viewers will watch distro encodes on their computer monitors and not on TV sets or projectors, then wouldn't PC scale luma make more sense for such encodes, for to take advantage of the full range possible on a monitor?
You mentioned ffmpeg; I do have ffdshow, the 6/6/2009 build to be exact, and it does offer HuffYUV encoding in YV12. No option for luma scale though as far as I can see.
- Qyot27
- Surreptitious fluffy bunny
- Joined: Fri Aug 30, 2002 12:08 pm
- Status: Creepin' between the bullfrogs
- Location: St. Pete, FL
- Contact:
Re: HuffYUV RGB->YUY2 conversion: TV/PC scale?
The original HuffYUV branch never did have a YV12 mode, as far as I know. Only ffvhuff does (and it also added adaptive huffman tables, which greatly improves compression). ffvhuff is what ffdshow has the capability to encode, and some configurations of it (YUY2 with adaptive tables off, for example) are compatible with the original branch. RGB-mode isn't accessible for ffvhuff through ffdshow, although it might be for standard ffmpeg or mencoder. I can't seem to get it (ffmpeg itself) to do so if it can, though.Scintilla wrote:My build of HuffYUV doesn't have a YV12 mode, it doesn't bother me.
I don't know how closely ffdshow's VFW Decoder and Encoder work together, but the color scale options are on the Decoder tab under 'RGB conversion', which is the very last one in the list.You mentioned ffmpeg; I do have ffdshow, the 6/6/2009 build to be exact, and it does offer HuffYUV encoding in YV12. No option for luma scale though as far as I can see.
I would also recommend making sure ffdshow is no more than about three or four months old, as decoder efficiency in libavcodec and features march on. DXVA for H.264 and VC-1 was added a couple months ago, but my graphics card is too old to use it (although it could use MPEG-2 if that got added). I can't even remember if the mid-2009 ffdshow builds had ffmpeg-mt for H.264.
My profile on MyAnimeList | Quasistatic Regret: yeah, yeah, I finally got a blog
-
- Joined: Tue Dec 25, 2007 8:26 am
- Status: better than you
- Contact:
Re: HuffYUV RGB->YUY2 conversion: TV/PC scale?
PC scale is silly if your content is TV scale already. Just leave it alone. Adobe and whatnot are generally made for Industry use so I would suggest that it's safe to assume they use TV levels regardless. I don't think it's important enough for you to have to worry about given you're already doing it wrong by using RGB at any stage to begin with. When it's wrong in one place, who cares if it's wrong in others. Nobody will notice.