VideoHelp Forum
+ Reply to Thread
Results 1 to 19 of 19
Thread
  1. Member
    Join Date: May 2009
    Location: United States
    Search Comp PM
    One glance at the yc waveform is all it takes to reveal the fact that my footage has been converted to RGB (fun black horizontal lines in the waveform), and after a dozen little tests, the culprit ended up being Avisynth. This won't do.

    I found this thread:
    http://forum.doom9.org/showthread.php?p=972148
    In it, the suggestion is made to convert the video to Huffyuv, and that the new file can be used in an avisource command without resulting in an automatic RGB conversion. I tried this out with UT Video Codec and it worked like a charm.

    The new problem with this process is a different kind of subtle degradation of the video. If I were to judge what's going on, it'd go something like this: UT Video Codec supports YUV420 and YUV422. Now, while theoretically YUV422 ought to be backwards compatible, so to speak, with the 4:1:1 video I am dealing with, in practice I recognize that the desirability of interpolating the chroma channel on such video means that the two really aren't compatible at all.

    Anyway, I figure rather than beating my head against a wall, there's probably a way of forcing Avisynth to skip the rgb conversion on raw video, so that's what I'm currently after. ;p

    (PS: Smoothlevels is great.)
    Quote Quote  
  2. If your source is uncompressed UYVY, what does 4:1:1 chroma subsampling come into play? If you have a DV source and to duplicate chroma samples rather than interpolate, use ffdshow as your DV decoder.
    Quote Quote  
  3. Member
    Join Date: May 2009
    Location: United States
    Search Comp PM
    Originally Posted by jagabo View Post
    If your source is uncompressed UYVY, what does 4:1:1 chroma subsampling come into play? If you have a DV source and to duplicate chroma samples rather than interpolate, use ffdshow as your DV decoder.
    It's not that simple in my case. The uncompressed UYVY is coming from Premiere Pro, wherein I have done considerable editing to my DV sources, and the ultimate intent is to output the entire cut-down DV as one big raw file which will then be fed to Avisynth.

    As for why I don't simply smart render the DV from Premiere Pro as DV, well, I could do that. But that would be no solution at all when it comes to other, non-DV footage, like the 1080i footage which will require pretty much the same external fixes (smoothlevels and QTGMC) and essentially must be rendered as raw.

    Incidentally, if I render raw from PPro and then convert it to UT Video with VDub, the luma levels above 235 get crushed, which is one of the problems this whole process is meant to avoid. So that's out.
    Quote Quote  
  4. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    describe your workflow exactly, and what decoders you are using

    you're probably converting to RGB in premiere , and that's causing the clipping

    uncompressed YUV (any fourcc) will remain YUV with AVISource() . If there was clipping, it was occurred before reaching avisynth
    Quote Quote  
  5. Member
    Join Date: May 2009
    Location: United States
    Search Comp PM
    Originally Posted by poisondeathray View Post
    describe your workflow exactly, and what decoders you are using
    Video is fed to Premiere Pro. For the time being, that means DV type 1 straight from the tapes. Once I get past this hump, future footage will include 1440x1080i MPEG2 straight from tapes, and 1920x1080p59.94 raws. The raws will be rendered from their AVCHD originals by something besides Premiere Pro due to the fact that PPro is incapable of decoding them without producing a severe chroma bug (even as of CS5) and Adobe evidently doesn't care. The raws will be replacing downscaled (720p) re-encoded proxy videos which I have created to ease the editing process.

    After editing the DV video, the intent is to render everything as raw, import to Avisynth, process, export as raw again with Virtualdub, and reimport to Premiere Pro for final integration into the whole video project. There are actually more steps which I may as well outline in brief:

    DV -> PPro -raw-> Avisynth, smoothlevels -> VDub -raw-> PPro, noise reduction -raw-> Avisynth, QTGMC -> VDub -raw-> PPro


    Originally Posted by poisondeathray View Post
    you're probably converting to RGB in premiere , and that's causing the clipping
    Rendering as uncompressed UYVY does not convert to RGB and does not clip. Rendering as UT does, though, so it is most likely UT that is clipping. The idea here, very simply, is to import the uncompressed UYVY into Avisynth without Avisynth converting to RGB.

    Originally Posted by poisondeathray View Post
    uncompressed YUV (any fourcc) will remain YUV with AVISource() . If there was clipping, it was occurred before reaching avisynth
    On my PC at least, this is not the case. I can re-import the uncompressed UYVY back into Premiere Pro and see for myself that it is unmodified (apart from a very, very slight alteration which I cannot explain, but which I am willing to deal with because it is in effect inconsequential). Also there is the thread I mentioned earlier wherein there is a more detailed cause for why Avisynth is converting Avisource uncompressed UYVY to RGB, although none of the suggestions in that thread will work in my case.
    Last edited by Asterra; 22nd May 2011 at 16:17.
    Quote Quote  
  6. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    Originally Posted by Asterra View Post
    Rendering as uncompressed UYVY does not convert to RGB and does not clip. Rendering as UT does, though, so it is most likely UT that is clipping. The idea here, very simply, is to import the uncompressed UYVY into Avisynth without Avisynth converting to RGB.
    How are you encoding to UT ? Through premiere?

    Because when you use UT through vdub in fast recompress mode (you bypass the RGB conversion and Rec.601 clipping)

    Let's clarify: Avisynth doesn't convert to RGB, unless you specify ConvertToRGB() . Something ELSE is causing the RGB conversion, like your decoder or a program upstream.


    Originally Posted by poisondeathray View Post
    uncompressed YUV (any fourcc) will remain YUV with AVISource() . If there was clipping, it was occurred before reaching avisynth
    On my PC at least, this is not the case. I can re-import the uncompressed UYVY back into Premiere Pro and see for myself that it is unmodified (apart from a very, very slight alteration which I cannot explain, but which I am willing to deal with because it is in effect inconsequential). Also there is the thread I mentioned earlier wherein there is a more detailed cause for why Avisynth is converting Avisource uncompressed UYVY to RGB, although none of the suggestions in that thread will work in my case.
    Need more details. You can try other uncompressed YUV. Something is setup differently on your system. Maybe you have some VFW codecs installed that force RGB - so try FFVideoSource() instead of AVISource()

    What kind of edits are you doing in Premiere? Most filters work in RGB, so if you applied some color correction etc...
    Quote Quote  
  7. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    Ahhh I didn't see your ninja edit on your post

    DV -> PPro -raw-> Avisynth, smoothlevels -> VDub -raw-> PPro, noise reduction -raw-> Avisynth, QTGMC -> VDub -raw-> PPro
    When you use the term "raw", do you mean uncompressed 8-but UYVY ? Because the term "raw" has other definitions in video.

    Anyways the "PPro, noise reduction" stage is most certainly where the RGB conversion is occuring. Unless you imported RGB, that is where the Rec601 clipping is occurring
    Quote Quote  
  8. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    I just did some quick tests with a full range 10-bit 422 YUV video (v210) , which definitely passes through premiere as YUV. This is the format I recommended to you in a couple of your other threads

    Exporting v210 (uncompressed microsoft AVI => V210) works fine (both avisynth with ffvideosource, and back into premiere YC waveform shows full range)

    If you use (microsoft AVI=> V210) , the fourcc is actually "012v" (byte order is backwards) , while this works fine for premiere, other programs don't see it as "v210", including ffvideosource

    "UYVY" isn't handled correctly by default decoder, when exporting out , nor does ffvideosource handle it correctly (you probably need 3rd party decoder installed, either vfw for AVISource, or directshow for directshowsource or dss2) . It is handled correctly importing back in
    Quote Quote  
  9. Member
    Join Date: May 2009
    Location: United States
    Search Comp PM
    Originally Posted by poisondeathray View Post
    How are you encoding to UT ? Through premiere?
    I need to clarify. The UT encoding was an experiment to see whether or not Avisynth could import some type of lossless video without converting to RGB. The result was that it could, but due of the interpolation-mandated nature of 4:1:1 video, I could not use this method.

    Originally Posted by poisondeathray View Post
    Let's clarify: Avisynth doesn't convert to RGB, unless you specify ConvertToRGB() . Something ELSE is causing the RGB conversion, like your decoder or a program upstream.
    Alright, I'm not trying to lay undue blame here or anything. Let me quote the thread I referenced earlier:

    Does anyone know a way of opening an AVI 2.0 (OpenDML) uncompressed 8-bit UYVY file without converting to RGB?
    "AviSource" calls "msyuv.dll" which inmediately converts to RGB.
    This could be what is happening in my case. In any event, the RGB conversion is there at the moment I import to Avisynth. (Directshowsource also performs an RGB conversion.)

    Originally Posted by poisondeathray View Post
    Need more details. You can try other uncompressed YUV.
    Premiere Pro doesn't give you much. Exporting as "Microsoft AVI" with "None" as the codec gives a clipped RGB conversion. Checking the "render at maximum depth" box during uncompressed UYVY export forces a considerable degradation of the video's sharpness, presumably owing to some sort of interpolation to a new bit depth. Then there's the choice to use v210 rather than UYVY. Avisynth hates these videos.

    Originally Posted by poisondeathray View Post
    try FFVideoSource() instead of AVISource()
    Just gave it a shot. Unfortunately all I got out of it was green frames. Apparently this is a common thing with this particular source filter.

    Originally Posted by poisondeathray View Post
    What kind of edits are you doing in Premiere? Most filters work in RGB, so if you applied some color correction etc...
    Temporal edits only. No red line indicating any processing. And anyway, until I've sorted out this RGB issue, all I'm using is a short (four-frame) clip for purposes of experimentation.

    Update: It seems the magical combination which may end up working is uncompressed v210 + FFVideoSource. No green frames on the four-frame clip. Crossing my fingers now. Thanks for the help as always!
    Quote Quote  
  10. Member
    Join Date: May 2009
    Location: United States
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Exporting v210 (uncompressed microsoft AVI => V210) works fine (both avisynth with ffvideosource, and back into premiere YC waveform shows full range)
    I see you beat me to it. ;p
    Quote Quote  
  11. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    LOL, I recommended v210 in your earlier threads . It's the "magic" one for premiere , allowing levels to go through untouched

    Vegas' "magic" one is IYUV



    Note, RawSource() is supposed to support UYVY, but there is corruption in the tests I did

    e.g. RawSource("UYVY.avi", 1280,720, "UYVY")

    YUYV, YVYU, UYVY, VYUY (interleaved horizontally subsampled resulting in AviSynth's YUV2)

    vdub "sees" the UYVY export correctly when opened natively (if you have "show image formats" checked, and use a null filter, both input and output are UYVY without corruption)
    Quote Quote  
  12. I verified that AviSource() always converts uncompressed UYVY AVI to RGB. I can't find any way around that. DirectShowSource("filename.avi", pixel_type="YUY2") works and retains superblack and superwhites (see note below). DSS2() can open the UYVY and automatically outputs YUY2 with no losses (see note below). VirtualDub can convert from uncompressed UYVY to YUY2 without any loss (Video -> Color Depth -> set output format). Can't Premiere be set to output YUY2 instead of UYVY?

    Note: I have ffdshow installed and the Raw Video decoder enabled and the output set to YUY2 only. Ie, ffdshow is acting as the decoder for UYVY and converting to YUY2.
    Last edited by jagabo; 22nd May 2011 at 17:58.
    Quote Quote  
  13. Member
    Join Date: May 2009
    Location: United States
    Search Comp PM
    Originally Posted by poisondeathray View Post
    LOL, I recommended v210 in your earlier threads . It's the "magic" one for premiere , allowing levels to go through untouched
    I remember. The reason why I put it out of mind was because nothing I tried at the time would force Avisynth to accept a v210 video. FFVideoInput was the missing ingredient.

    Incidentally, I'd be interested in hearing your thoughts on Premiere Pro's very subtle degradation of the video when outputting as uncompressed v210 (or UYVY). Try with my handy DV clip:

    dv_fireworks01.avi

    Just save as uncompressed v210 or UYVY, reimport, go to the yc waveform and compare with the original. The degradation is the same whether you choose v210 or UYVY, and it's definitely not identical to the DV original. I don't consider it a huge deal, but it does bug me somewhat.
    Quote Quote  
  14. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    They look the same to me in the YC Waveform. Are you looking at the same frame between the original and v210 ?
    Quote Quote  
  15. I suspect somewhere along the line there is a YUV to RGB conversion and back. Not all 8 bit YUV values map to unique RGB values and vice versa. So converting YUV to RGB then back to YUV will not return the original values. That will cause a few "holes" in a waveform monitor.
    Quote Quote  
  16. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    AFAIK, premiere works in YUV with a DV-AVI only project

    I guess there is a very subtle change , here are some comparisons, the original, v210, and dv export . dv is smart rendered so of course that is the same.
    Attached Files
    Quote Quote  
  17. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    If anyone is haveing difficulty seeing the differences, look around 20IRE

    It might be 422 vs 411, but that shouldn't show up in a Y waveform

    It might be 10-bit vs. 8-bit handling and how premiere rounds off or truncates values

    There are differences shown in other programs between the original and v210 export (e.g. difference masks) but that depends on how the upsampling is done
    Quote Quote  
  18. Member
    Join Date: May 2009
    Location: United States
    Search Comp PM
    I was all set to show the differences I am seeing but it looks like folks have already noticed them. I'll post this little image anyway since I went through the trouble.

    Name:  dv_degrade1.gif
Views: 286
Size:  58.1 KB

    It does look a lot like what you get with an RGB conversion, and that's why this is bugging me. Why go through all this trouble if a RGB-conversion-like amount of degradation is taking place anyway? Well whatever it is - and I note that there's no clear answer here - it's not the same thing you get with a definite RGB conversion. The differences from the original are similar but distinctly different from one another. I also don't think it has to do with 10-bit vs 8-bit because if you export as v210 and also as UYVY and compare the two, the two results are in fact identical.
    Quote Quote  
  19. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    Originally Posted by Asterra View Post
    It does look a lot like what you get with an RGB conversion, and that's why this is bugging me. Why go through all this trouble if a RGB-conversion-like amount of degradation is taking place anyway?
    I don't think so. Values would be clipped >100IRE if a Rec601/709 RGB conversion was done, but 100-110 still exists




    It still could be 4:2:2 vs. 4:1:1 for DV. Both v210 and UYVY are upsampled to 4:2:2, but I don't know why the luminace would be different; I thought Y should be independent of Cb,Cr
    Quote Quote  



Similar Threads