![]() |
Yep thats the sense, but ....
I don't need to pu a converttoYUY2() at the end so CCE can handle it correctly, like phil also reported. But that maybe depends on the CCE Vers. u use. And I still don't know WHY you still get washed colors from YV12 4:2:0 avs outputs even xvid is decompressor instead of ati codec. :? |
@jorel: Just one quick question... Were your ATI codecs listed under 'A' in DXMan? Because I just wanted to make sure that I use the correct Decompressor... I can't find any ATI codecs with DXMan BUT, I also don't see XviD codecs although I know that they're installed... :roll:
|
Quote:
i'm using cce 2660107 that don't need the convertion :arrow: but,don't know why,don't work without converttoYUY2() in the script :arrow: using XviD codec! 8O more details: have the washed colors ONLY using the ati codecs WITHOUT converttoYUY2() in the script, with XviD codec the colors don't change,but is equal the best color of ati codec. using the converttoYUY2() in all situations is better but, without use with xvid codec in cce266 don't work :!: i can't explain the reason,don't know why! :? :? :? sorry the "redundant" words! :wink: |
Quote:
:arrow: DXMan can't find the ati codecs :!: try control pannel-multimedia-video codecs, for me was the only way. but can find the xvid and in properties we can adjust brightness and all parameters of the codec. is the last of the DXMan list (here show in alphabetical order) :wink: |
Test Results
As promised, here's the results of the tests I did with TMPGEnc:
Part 1 Introduction TMPGEnc expects its input to be RGB24, and will use the codecs installed on the system to convert it if it's in another format. However, the ATI YUV12 Codec is broken (more on that in a future post), so colours will be distorted if an AviSynth script outputs YV12. Placing ConvertToYUY2() at the end of the script will force AviSynth to do the conversion to a codec that is not broken, but TMPGEnc will still have to convert the incoming YUY2 data to RGB. Hypothesis If the system is plagued with ATI's codecs, using ConvertToRGB24() at the end of an AviSynth script will eliminate one colourspace conversion and be slightly faster than using ConvertToYUY2(). Since in any case, TMPGEnc will convert the incoming data to RGB, this is not expected to lose any more chroma information than any other method. Experiment 1. I ripped a short, 4:05 clip (actually, it's the music video for UHF by Weird Al Yankovic, from his Complete Video Collection). The AVS is very simple: FieldDeinterlace() followed by a resize to 352x240; the image itself isn't important, I just wanted something small that wouldn't take long to encode (since I'll be encoding it about a dozen times). 2. The first encode was done with my basic script. The output was YV12, and therefore would need the ATI codec to convert it to RGB24. I ran TMPGEnc with the same input twice and kept the lowest time, since ideally most of the input would be cached and hard drive accesses wouldn't be a factor. TMPGEnc was the only program running, other than the usual processes running on Windows XP. 3. I repeated the process three more times, each with ConvertToYUY2(), ConvertToRGB24(), and ConvertToRGB32() as the very last line in the script. 4. I ran each conversion again, just to be sure, and once more kept the lowest times for each colourspace. Results
Notes Surprisingly, the YV12 encode (when the ATI codec was used) was the slowest. This seems to indicate that the YV12 -> RGB conversion code in AviSynth is much more optimized than the code in the ATI codec. As expected, the RGB24 encode was the fastest, but by a very small margin. The next fastest encode was with YUY2 output, but this requires an additional colourspace conversion. RGB32, despite being aligned on 32-bit boundaries, was slightly slower (perhaps TMPGEnc always uses RGB24, and does a conversion when presented with RGB32 input). Conclusions If you're stuck using the ATI YUV12 codec (as it seems some of us are), and you're using TMPGEnc to create your MPEG video, add ConvertToRGB24() as the very last line of your AviSynth script. I also wonder which is faster at converting from YV12 to RGB, AviSynth or the XviD codec (assuming they give the same results). If the AviSynth code is faster, all TMPGEnc users (not just those with the ATI codec) will benefit from using ConvertToRGB24() in their scripts. Although I have no evidence to support this yet, I'd expect CinemaCraft users (also only those with ATI's codec) to be better off adding ConvertToYUY2() to the bottom of their scripts since it accepts YUY2 input (the loss by interpolating every other line of chroma is much less than what ATI's codec does). Part 2 coming soon: the problem with the ATI YUV12 Codec (as soon as I finish lunch :drink: ). |
Test Results, Part 2
Here's the second part of my tests:
Part 2 As jorel explained, the ATI YUV12 Codec incorrectly converts from YV12 to RGB. The colours look "washed": there's less contrast and they generally look duller. Here's why: YUV data is usually clamped, the luma (Y) component to [16,235], and the chroma (U and V) components to [16,240]. This is exactly what Limiter() does. But the ATI codec scales the values to those ranges instead. So a clip that's all black (Y,U,V = 0,128,128) will be turned into (Y,U,V = 16,128,128) by Limiter(). Then when the ATI codec gets ahold of it, it will scale the ranges further, so the resultant will be (Y,U,V = 30,128,128). Similarly, something all white (Y,U,V = 255,128,128) will result in (Y,U,V = 217,128,128). You can already guess that this will reduce the contrast of the video. Actually, the formula for scaling would be something like: Code:
y' = y * (235 - 16) / 256 + 16Code:
yv12=DirectShowSource("yv12.m1v").ConvertToYV12().Histogram("Levels").Subtitle("YV12")Here's the output: http://www.digitalfaq.com/archives/error.gif As you can see, the contrast is much lower in the YV12 version. Also look at the black bar on the right side of the image (between the image and the histogram), it's slightly brighter than the RGB24 version. And from the histogram, you can see that all three components are "compressed" into a smaller range (the leftmost bar on the Y component represents all the values clamped to 16 by Limiter(), but shifted over by the ATI codec). Now, here's the same thing with Levels(16,1,235,0,255,false) added to the YV12 version: http://www.digitalfaq.com/archives/error.gif The colours are almost back to the original, but obviously some information is lost (the black bars in the histogram). (The Levels() command given isn't perfect either, it doesn't rescale the chroma properly. Something with UToY()/VToY()/YToUV() could, though.) Doing a more direct comparison, here's the results using the following script: Code:
yv12=DirectShowSource("yv12.m1v").ConvertToYV12() #.Levels(16,1,235,0,255,false)http://www.digitalfaq.com/archives/error.gif With Levels() uncommented: http://www.digitalfaq.com/archives/error.gif In conclusion, don't use the ATI YUV12 Codec if you can avoid it. If you're stuck with it, and you're using TMPGEnc, add ConvertToRGB24() to the end of any AviSynth scripts you have returning results in the YV12 colourspace. If you're using CCE, using ConvertToYUY2() may or may not be an improvement... |
Where can I download Xvid YV12 codec?
I do not see it listed on the Xvid site. |
Quote:
but no problem... incredible post the link in the first page, take a look: "incredible Posted: Fri Mar 12, 2004 3:25 pm" http://www.kvcd.net/forum/viewtopic....er=asc&start=0 :wink: @ BobNET: i'm still reading your 2 great (very cool) last posts with pictures! :) |
That was the post at 4:25 pm :wink:
But here's the link ..... :) http://roeder.goe.net/~koepi/xvid.shtml |
Thanks. I just wasn't sure what to use. I un-installed the ATI codec and executed XviD-1.0-RC3-29022004.exe. Everything seems to still be working, but I am still checking. The last time I tried a different YV12 codec it messed up some other software, but this seems to be OK (I do not have ATI video card).
|
Site design, images and content © 2002-2026 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2026 Jelsoft Enterprises Ltd.