VideoHelp Forum




+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 50
  1. Hello guys, thank you in advance for any help you might be able to provide.

    I'm having a problem with Sony Vegas Pro 12 that I've been searching for a solution to for days now.


    I run a Youtube channel and my codec of choice has been MainConcept AVC. Normally, to get the proper colors for youtube, I adjust the levels to "Computer RGB to Studio RGB" and then encode. The uploaded product looks just like the original source, and everything's dandy.

    However, lately, I've needed to switch to AVI due to a sound quality problem I've noticed with AVC. AVI tested better than all the rest in terms of audio quality for YT, so I want to stick with that format if I can. The problem is, I can't encode a video to AVI in one of the lossy formats without some sort of color shift occuring that makes the Youtube video come out much, much darker than its AVC counterpart. The colors lose all vibrance to them.

    I was thinking this might be some sort of setting in my AVI codecs, but I can't seem to isolate the problem. Anything I change seems to make it worse, in fact.

    Looking at the encoded videos before upload, I notice that the AVC videos are quite a bit brighter than the source material, while the AVI looks identical. After upload, the brighter AVC becomes normal looking. The AVI becomes much too dark.


    So I tried messing with Sony Levels again to see if I could correct the problem for the AVI. No joy. I can brighten it, but it never looks quite right.

    There is one AVI codec that does look correct, however, and that is Sony YUV. It comes out looking just like the AVC file...but the file size is much too large for Youtube.

    So, can someone please help me figure out how to adjust my AVI codecs to produce a color space similar to AVC or Sony YUV? I currently have ffdshow, x264vfw, and Xvid all installed. I've tried them all and all give similar results. There seem to be very few controls over color space in all three of these codecs.

    Is there a better codec out there that might give me control over this problem? Does anyone know how to set these codecs to give a more pleasing result? My end goal is to have the youtube video look like the source material. Surely if AVC can do that, there's a way to make AVI do that as well?

    Thank you in advance. I'm happy to provide any additional info you need.
    Quote Quote  
  2. It's not a colors issue as such, I don't think.

    PC's use full range luminance levels (0-255) whereas most video uses limited range or TV levels (16-235). The latter is possibly what your program calls "studio RGB". The TV levels used for video mean "16" is back and "235" is white. To display correctly on a PC the levels need to be expanded to 0-255. Effectively though, play video on a PC without expanding the levels and it looks brighter or washed out. Use PC levels when playing video with a player which expects it to use TV levels and it looks too dark.

    When you encode, the levels are generally encoded "as-is" so it's probably not the encoder causing the problem. Unfortunately you haven't said what type of video you're encoding or which player you're using to view the encoded video so it's hard to guess which levels it uses and what the player is doing. Maybe the "Computer RGB to Studio RGB" setting only has an effect when using the program's internal codecs but not external ones, or it might also depend on the type of video you're encoding (or if it's RGB). I don't really know. Or are you using a different program to encode the AVIs?

    From what you describe the logical conclusion is during the process the AVC video is being encoded using the correct levels (TV) so if the input was PC levels it's being converted correctly. You play the AVC video on the PC but it's levels aren't being expanded so it looks washed out, however after uploading to YouTube it displays correctly. The AVI is being encoded using PC levels, so it looks fine on the PC because the levels aren't being expanded and the PC uses PC levels, but it's uploaded to YouTube where it's assumed it uses TV levels so ultimately is displays too dark.

    Anyway, I'd start by getting your PC to always expand the levels on playback which I think should fix the "displays different on YouTube" issue. Most video cards have a setting for levels somewhere that should ensure video displays correctly on your monitor regardless of the type or the player you're using. Next would be to convert the levels when encoding the AVIs but without knowing what type of video and the source is and how it's being decoded and fed to the encoder etc it's hard to be specific. And if you're doing all the work using Sony Vegas then unless ffdshow is decoding I wouldn't have a clue as I've never used it.

    There's some info on this page which might help you, but it's a little out of date (for instance ATI drivers have a setting for luminance levels these days) and I probably should mention a few things in case it confuses you.

    The page makes references to the way luminance levels might be displayed according to resolution. You can probably ignore that as these days it's displayed one way or another regardless of resolution. I think it was an old video card/driver problem.
    Unless you know what it refers to ignore the BT.601 and BT.709 references for the moment as they don't relate to TV vs PC levels as such.
    The methods suggested for using ffdshow to convert the levels work, but method #2 only applies if ffdshow is converting to RGB. If the input is already RGB I don't think it'll work. If you use method #3, check "force RGB conversion" in the levels filter or it can mess with the colours, otherwise it'll work fine. Method #5 obviously requires AVISynth to be installed and it's the method I'd use but you need to know the type of input video you're dealing with and a bit about AVISynth or you could drive yourself mad trying to get it to work.

    Anyway, hopefully some of the above will at least point you in the right direction.
    Last edited by hello_hello; 16th Jan 2013 at 00:24.
    Quote Quote  
  3. Originally Posted by hello_hello View Post
    Unfortunately you haven't said what type of video you're encoding or which player you're using to view the encoded video so it's hard to guess which levels it uses and what the player is doing. Maybe the "Computer RGB to Studio RGB" setting only has an effect when using the program's internal codecs but not external ones, or it might also depend on the type of video you're encoding (or if it's RGB). I don't really know. Or are you using a different program to encode the AVIs?
    Here's what I'm doing. I'm loading PNG images into the timeline for Vegas, which are used for the video frames (so, a static background).

    If I encode in AVC, and then upload to youtube, the colors on the youtube video become "clipped", with too much contrast, too bright, etc. If, however, I use the "Computer RGB to Studio RGB" levels adjustment in vegas, then the youtube video is not clipped, and the colors look the same as the original PNG background files.

    Now, with FFDShow, x264, or Xvid being used as the codec, I have exactly the opposite problem. The uploaded youtube video does not have enough contrast, looks dull, darker, less vibrant.

    So, logically, I tried to apply the opposite levels effect to fix this: Studio RGB to Computer RGB. While this brightened the image, it did not fix the problem and the contrast was still all wrong.

    I then went into FFDshow's "Video Processor Configuration" and made a levels adjustment. I think screenshots at this point will help illustrate the issue. The levels adjustment, plus the "Studio to Computer RGB" additional levels adjustment, produced a still-brighter image, but again the colors are all wrong.

    Here's some screenshots:

    AVC:

    Left: The original PNG image, unaltered. Middle: Video screenshot using VLC media player on computer. Right: Video as it looks on youtube.
    As you can see, the original and the youtube version are nearly identical, off by only a slight amount.

    FFDShow MJPEG encoder (used in Vegas) with default settings:

    Left: Original PNG. Middle: VLC media player on computer. Right: Video on Youtube. (Much too dark)

    FFDShow MJPEG encoder (Used in Vegas) with Studio to Computer RGB levels adjustment in Vegas, plus additional levels adjustment in Video Processor settings in FFDShow:

    Left: Original PNG. Middle: VLC. Right: Video on Youtube. (Closer, but still off, weird contrast issues, black is no longer black, but is instead at 15, etc).

    And here are the settings I used for that last one:

    Left: Sony vegas levels settings. Right: FFDshow encoder levels settings.


    None of it comes out right. So I'm trying to figure out what to adjust in FFDshow (because it gives more color control than X264 and Xvid do in Vegas), to produce a video that once uploaded to youtube, will look like the original.

    Hope this helps. I do a lot of color restoration on this channel and I hate to see that work wiped out by video processing that dulls the image or messes with the contrast. While I realize it's "just youtube", this channel is a very large project I'm working on with the endorsement of BSOD, and in cooperation with several deadmau5 discography sites. So I need to get this right.
    Quote Quote  
  4. It's a very complex issue for vegas

    The short version is vegas handles different formats differently

    Some formats are converted to RGB internally using computer RGB, but others studio RGB. To complicate issues even more, your project settings alter the way the things are converted (8bit mode, vs 32bit mode full range, but 32bit has 2 modes "video" levels and full range). And to complicate even more, vegas handles export formats different. The same video , same project, same settings exported to say, wmv vs. mp4 will have different levels.

    http://www.glennchan.info/articles/vegas/colorspaces/colorspaces.html
    http://www.glennchan.info/articles/vegas/v8color/v8color.htm
    http://www.glennchan.info/articles/vegas/v8color/vegas-9-levels.htm

    The only certain thing is , it's not the export codec's fault, it's not youtube's fault. The export codec can only encode what it's receives. Youtube doesn't change Y' levels (it encodes what it receives)

    I suspect your setup isn't calibrated correctly either , which makes it *very* difficult to debug

    Looking at the encoded videos before upload, I notice that the AVC videos are quite a bit brighter than the source material, while the AVI looks identical. After upload, the brighter AVC becomes normal looking. The AVI becomes much too dark.
    How are you determining this? What software are you using for viewing the export? How you "percieve" something can change dramatically based on the renderer used. The levels can be completely different even on the same video.

    What is the source material ?



    Instead of learning all this, or debugging the issue - it might be easier to fix the audio problem. What was the problem with the audio?
    Quote Quote  
  5. Originally Posted by Fox_720 View Post
    Left: Sony vegas levels settings. Right: FFDshow encoder levels settings.


    None of it comes out right. So I'm trying to figure out what to adjust in FFDshow (because it gives more color control than X264 and Xvid do in Vegas), to produce a video that once uploaded to youtube, will look like the original.
    The problem here is that is FFDShow DEcoder. That doesn't affect ENcoding, unless you have FFDShow decoding the input video first. Vegas doens't use directshow or FFDShow for DEcoding
    Quote Quote  
  6. FFDShow MJPEG encoder (Used in Vegas) ...
    Quick comment on MJPEG encoding - this will give you headaches on youtube, because youtube decodes MJPEGas YUVJ (this is full range) . This means contrast will stretch, image will look "washed out". For full range, YUV 0-255 gets converted to RGB 0-255 for display. Most videos are handled with "legal range" or Y'16-235 , UV 16-240 => RGB 0-255.
    Last edited by poisondeathray; 16th Jan 2013 at 10:23.
    Quote Quote  
  7. Here is what I would do if you don't want to spend hours/days learning the idiosyncracies of vegas and "levels"

    1) Attempt to address the audio issue that started you down this dark, dark, path

    If that didn't pan out:

    2) Use debugmode frameserver + some gui for x264 e.g. ripbot , megui. It's easier to fix levels in avisynth

    If your only assets were .png (if you look at those articles, image formats use computer RGB in vegas, regardless of project settings. RGB is RGB, there is not YUV<=>RGB conversion which is the basis for all these headaches in vegas) , I would frameserve out using RGB, then a simple ConvertToYV12() in the script will turn those RGB levels to "legal" YUV levels and look fine on youtube

    e.g.
    AVISource("signpost.avi")
    ConvertToYV12()

    (There are a couple of "gotchas" in regards to flash, How it uses Rec709 vs. Rec601 for display, but the black and white point will not be affected. Moreover, the client setup and flash HW acceleration on/off affects this (you have no control). If you want more info, ask)
    Quote Quote  
  8. Originally Posted by poisondeathray View Post
    Originally Posted by Fox_720 View Post
    Left: Sony vegas levels settings. Right: FFDshow encoder levels settings.


    None of it comes out right. So I'm trying to figure out what to adjust in FFDshow (because it gives more color control than X264 and Xvid do in Vegas), to produce a video that once uploaded to youtube, will look like the original.
    The problem here is that is FFDShow DEcoder. That doesn't affect ENcoding, unless you have FFDShow decoding the input video first. Vegas doens't use directshow or FFDShow for DEcoding
    Actually, it is the encoder. Have a look:



    FFDShow has an option to apply processing filters and effects to the video through the encoder. There is a separate decoder tab, as you can see here, and none of the settings on that tab seem to affect the output. anything changed on the encoder tab, by clicking the "configure" button here, do change the video levels. To be sure of this, I tried an extreme example by setting the sliders to a very narrow range, and the video came out a mess.

    As for Youtube, it does convert color space. My understanding is that it uses the Rec 709 algorithm, but other say it uses Rec 601, so I can't be sure. It doesn't simply use what it receives. It's all converted to youtube's default color space. However, YT gives no hints on how to configure your video to match this, aside from saying to encode in 4:2:0. Yet mediainfo says that all three of these videos are in 4:2:0.

    As for the color shift, I am using Photoshop and Paint Shop Pro. simple use of the sample tool shows you the differences in hue and color levels. But even if VLC was displaying the videos incorrectly, they all look different from each other on youtube, so I know this is not an internal display problem. the videos genuinely are different from each other in terms of levels and/or color space, I'm afraid.

    It has to be some sort of disagreement in the settings of FFDshow, x264, Xvid, etc....and Vegas. I just don't know how to fix it so that the video that is rendered to my computer, "re-processes" on Youtube back to the colors that should be displaying.
    Quote Quote  
  9. As for the audio issue, the problem is that the audio is coming out muffled on youtube. AVC only allows me to go up to 512kbps, and I've tried it with 384 (recommended settings on YT), 320, 256, 192, and so forth. It used to come through quite clear, but no longer does. AVI sounds perfect, however. I'd have an easier time if I could use Quicktime, as there are many more encoder choices for that container, but the audio still sounds inferior on YT compared to the AVI file. If i can just get this color issue fixed, I'm back in business.
    Quote Quote  
  10. Originally Posted by Fox_720 View Post
    [

    FFDShow has an option to apply processing filters and effects to the video through the encoder. There is a separate decoder tab, as you can see here, and none of the settings on that tab seem to affect the output. anything changed on the encoder tab, by clicking the "configure" button here, do change the video levels. To be sure of this, I tried an extreme example by setting the sliders to a very narrow range, and the video came out a mess.
    I never knew this about ffdshow, thanks

    As for Youtube, it does convert color space. My understanding is that it uses the Rec 709 algorithm, but other say it uses Rec 601, so I can't be sure. It doesn't simply use what it receives. It's all converted to youtube's default color space. However, YT gives no hints on how to configure your video to match this, aside from saying to encode in 4:2:0. Yet mediainfo says that all three of these videos are in 4:2:0.
    It does not. Y'CbCr video gets passed through as Y'CbCr when it re-encodes. Colorspace conversions only occur with RGB<=>Y'CbCr conversions (the exceptions are some like MJPEG, which get DEcoded as full range before it re-encodes , and thus are reflected in the youtube re-encoded video). You aren't looking at Y'CbCr directly when you look at monitor - you're looking at the RGB converted representation . If you use Y'CbCr with 4:2:2 or 4:4:4, technically it's not a "colorspace" conversion when it subsamples to 4:2:0 . IF you upload RGB video, then it gets converted to Y'CbCr using Rec.601 (and then follows the following rules for display)

    Here is how flash works (note the conversions are only for display, underlying video levels are unchanged, you can check by downloading the re-encoded video with a waveform monitor)
    HW on: Y'CbCr => RGB using Rec601

    HW off, no matrix specified: Y'CbCr => RGB using Rec.709
    HW off, matrix specified: Y'CbCr => RGB using matrix specified (but youtube re-encodes ignoring flags, so matrix is irrelevant, thus all HW "off" clients will use Rec.709)
    Last edited by poisondeathray; 16th Jan 2013 at 10:49.
    Quote Quote  
  11. Originally Posted by Fox_720 View Post
    As for the audio issue, the problem is that the audio is coming out muffled on youtube. AVC only allows me to go up to 512kbps, and I've tried it with 384 (recommended settings on YT), 320, 256, 192, and so forth. It used to come through quite clear, but no longer does. AVI sounds perfect, however. I'd have an easier time if I could use Quicktime, as there are many more encoder choices for that container, but the audio still sounds inferior on YT compared to the AVI file. If i can just get this color issue fixed, I'm back in business.

    What audio are you using for AVI? uncompressed ?
    Quote Quote  
  12. Originally Posted by poisondeathray View Post
    Originally Posted by Fox_720 View Post
    As for the audio issue, the problem is that the audio is coming out muffled on youtube. AVC only allows me to go up to 512kbps, and I've tried it with 384 (recommended settings on YT), 320, 256, 192, and so forth. It used to come through quite clear, but no longer does. AVI sounds perfect, however. I'd have an easier time if I could use Quicktime, as there are many more encoder choices for that container, but the audio still sounds inferior on YT compared to the AVI file. If i can just get this color issue fixed, I'm back in business.

    What audio are you using for AVI? uncompressed ?


    Correct. I have tried various other codecs with uncompressed audio, but for some reason YT processes it differently, and it sounds inferior. I have checked this using Adobe Audition, and indeed after youtube processing of AVI versus QT versus XD cam, etc, the audio spectrum is different for each one. Although quicktime's uncompressed audio also displays a spectrum difference before upload, as well. All are encoded in 16-bit, little endian, 48,000hz uncompressed audio.

    As far as the color conversion, I am curious as to why these three videos which are all in YUV, all in 4:2:0 color space, display differently on Youtube. It's common knowledge that youtube clips videos unless you adjust levels, as it uses 16-235 versus 0-255, so I'm used to having to adjust for that, except in certain codecs like WMV, which I do not have to adjust for. AVC requires adjusting.

    The codecs for AVI seem to be behaving differently altogether, however.

    I will be back in a couple of hours, I have university classes to attend and then I'll pick up from there. Thank you for your help so far!
    Quote Quote  
  13. Originally Posted by Fox_720 View Post
    Originally Posted by poisondeathray View Post
    Originally Posted by Fox_720 View Post
    As for the audio issue, the problem is that the audio is coming out muffled on youtube. AVC only allows me to go up to 512kbps, and I've tried it with 384 (recommended settings on YT), 320, 256, 192, and so forth. It used to come through quite clear, but no longer does. AVI sounds perfect, however. I'd have an easier time if I could use Quicktime, as there are many more encoder choices for that container, but the audio still sounds inferior on YT compared to the AVI file. If i can just get this color issue fixed, I'm back in business.

    What audio are you using for AVI? uncompressed ?


    Correct. I have tried various other codecs with uncompressed audio, but for some reason YT processes it differently, and it sounds inferior. I have checked this using Adobe Audition, and indeed after youtube processing of AVI versus QT versus XD cam, etc, the audio spectrum is different for each one. Although quicktime's uncompressed audio also displays a spectrum difference before upload, as well. All are encoded in 16-bit, little endian, 48,000hz uncompressed audio.
    I think there is a new bug in youtube's aac decoder, it was introduced recently within the last few days (I see a few mentions of this on several sites)

    Now this is weird - all versions used uncompressed audio, and the processed audio is slightly different for each one ? The only difference was the container, and video compression?

    As far as the color conversion, I am curious as to why these three videos which are all in YUV, all in 4:2:0 color space, display differently on Youtube. It's common knowledge that youtube clips videos unless you adjust levels, as it uses 16-235 versus 0-255, so I'm used to having to adjust for that, except in certain codecs like WMV, which I do not have to adjust for. AVC requires adjusting.
    MJPEG is an exception, because of the decoder youtube uses (it decodes at full range)

    Youtube "clips" on display , because it's supposed to . Standard Rec601/709 conversion matrix specifies Y'16-235 CbCr240 => RGB 0,0,0 - 255,255,255. This is standard. Thus "illegal levels" will be clipped = normal and standard practice . It doesn't clip the underlying video. If you have a full range Y' 0-255 video, and download the re-encoded video from youtube, it will be the same levels 0-255. (ie. levels are passed through untouched) . The clipping occurs only on display (when it gets converted to RGB for display).
    Quote Quote  
  14. Be careful about using media players (this can include players in browsers) when comparing levels. You have to know how each one gets video from the file to the screen. Most will use the graphics card's video proc amp (not the Desktop proc amp) so you must have that calibrated correctly. The default settings on a graphics card driver install are often not right. Use a calibration video to set the video proc amp. And as was mentioned, players and codecs can use their own filters to adjust the video before giving it to the graphics card. Make sure the player's and codec's filters are turned off.

    https://forum.videohelp.com/threads/326496-file-in-Virtualdub-has-strange-colors-when-o...=1#post2022085

    Most software automatically converts RGB 0-255 to YUV 16-235, and vice versa. Vegas is an exception. It handles different types of video differently. MJPEG is another exception. Most MJPEG encoders and decoders keep the full 0-255 range when converting RGB to YUV and back (because JPEG does so). So you have to know exactly where all your RGB/YUV conversions are happening.
    Quote Quote  
  15. Originally Posted by poisondeathray View Post
    Now this is weird - all versions used uncompressed audio, and the processed audio is slightly different for each one ? The only difference was the container, and video compression?

    That's correct. Strange, isn't it? Youtube's processing is mystifying at times. But indeed, different containers yeild different audio processing methods, even if all the containers use the same kind of uncompressed audio. I can't use audio with XDcam, for example, unless I apply a decent amount of EQ to it. Otherwise, it comes out sounding flat, and spectrum analysis will indeed show quite a bit of shift versus the same video encoded with AVI.

    Originally Posted by jagabo View Post
    Be careful about using media players (this can include players in browsers) when comparing levels. You have to know how each one gets video from the file to the screen. Most will use the graphics card's video proc amp (not the Desktop proc amp) so you must have that calibrated correctly. The default settings on a graphics card driver install are often not right. Use a calibration video to set the video proc amp. And as was mentioned, players and codecs can use their own filters to adjust the video before giving it to the graphics card. Make sure the player's and codec's filters are turned off.

    https://forum.videohelp.com/threads/326496-file-in-Virtualdub-has-strange-colors-when-o...=1#post2022085

    Most software automatically converts RGB 0-255 to YUV 16-235, and vice versa. Vegas is an exception. It handles different types of video differently. MJPEG is another exception. Most MJPEG encoders and decoders keep the full 0-255 range when converting RGB to YUV and back (because JPEG does so). So you have to know exactly where all your RGB/YUV conversions are happening.
    I've done an extensive search, but I'm not coming up with consistent answers on how exactly these codecs are converting RGB/YUV.

    Perhaps I'll try this from another angle: Do you know of any other AVI codecs that might work with Vegas? I used to use DivX to process AVI, but it no longer is supported on Vegas Pro 12. I have lagarith, but youtube does not accept Lagarith encoded videos. x264vfw gives me very, very little control over encoding parameters, and while Xvid gives more, there's no control over color space unless you type in a custom matrix.

    I'd like something that gives me output similar to Sony YUV, as that one produced a video that looked correct after upload to Youtube.

    My guess is that x264, xvid, ffdshow, all have some sort of internal conversion going on that you can't turn off...or that I don't know how to turn off. I tried forcing different input colorspaces, but this resulted in an error from vegas when trying to encode. No luck. forcing an output colorspace like YUY2 vs YV12 yeilded no improvement.

    I have a few encoder options under ffdshow as well. With the mjpeg option, I don't quite understand regarding it expanding the levels to 255 full range, etc...shouldn't that make it brighter, not darker?

    encoding with YuffYUV ffdshow produced fairly similar results at a larger file size. FFV1 was pretty efficient in terms of compression, but looked mostly the same as Mjpeg. I'm not sure about DV.

    So maybe another codec might work better.


    Also, as far as my graphics card goes, I'm using an old Radeon X850 XT. My catalyst control center shows no controls for adjusting 16-235 versus 0-255. There is a color tab, but I think using it is going to be a bit more involved than the nvidia method.


    I did notice the ability to use RGB 32 floating point in Vegas project settings. Is it better to use Video levels or full range?
    Last edited by Fox_720; 16th Jan 2013 at 13:22.
    Quote Quote  
  16. Originally Posted by Fox_720 View Post
    Originally Posted by poisondeathray View Post
    Now this is weird - all versions used uncompressed audio, and the processed audio is slightly different for each one ? The only difference was the container, and video compression?

    That's correct. Strange, isn't it? Youtube's processing is mystifying at times. But indeed, different containers yeild different audio processing methods, even if all the containers use the same kind of uncompressed audio. I can't use audio with XDcam, for example, unless I apply a decent amount of EQ to it. Otherwise, it comes out sounding flat, and spectrum analysis will indeed show quite a bit of shift versus the same video encoded with AVI.
    Are you talking big differences, or just tiny audiophile-can-only-tell differences?

    The recent aac decoding bug is huge difference (probably what prompted you to deviate from what you were doing in the past)



    I've done an extensive search, but I'm not coming up with consistent answers on how exactly these codecs are converting RGB/YUV.
    Unless you control the conversion, 99.999999999% will do Y' 16-235, CbCr 16-240 <=> RGB 0,0,0 -255,255,255 . So if you feed a codec RGB input, the output Y'CbCr video will have Y'16-235, CbCr 16-240 . The problem is vegas doesn't necessarily feed RGB to the codec. Moreover, Recall I said it handles different export formats, differently. (It can prefilter before sending to the codec). Read those Glen Chan articles if you want more info. You cannot access where/how what vegas is doing at that export stage. You just have to do a lots of tests . That's why Exporting out RGB out of vegas and using another program will give you full control



    Perhaps I'll try this from another angle: Do you know of any other AVI codecs that might work with Vegas? I used to use DivX to process AVI, but it no longer is supported on Vegas Pro 12. I have lagarith, but youtube does not accept Lagarith encoded videos. x264vfw gives me very, very little control over encoding parameters, and while Xvid gives more, there's no control over color space unless you type in a custom matrix.
    You're probably using an outdated or simple GUI. Download from here
    http://komisar.gin.by/

    In addition, you can access the commandline from this version, so you have (almost) every option available as in the CLI version
    http://mewiki.project357.com/wiki/X264_Settings

    IMO you're doing this the wrong way. Encoding options aren't meant to adjust levels. Each extra conversion you do, you incur additive quality loss (conversions between Y'CbCr<=> RGB are lossy, and each "trip" you add up more loss, if you take a few "trips", the color edges will become blurred) .

    As mentioned earlier, the standard matrices (e.g. Rec709 vs. Rec601) won't affect the black and white point, the colors will just be slightly shifted (the PC range matrices will however, affect levels). Your problem is a levels issue. You can use x264 to adjust the levels using --input-range and --range . The problem is you don't know what vegas is "handing off" before x264vfw (or any other AVI codec) . Did it already convert to Y'CbCr? what range? what coefficeints were used? The VUI options of x264's --colormatrix don't affect the actual encoding or video data (they are just flags), hence the recommendation to use aviysnth where you can control the exact Y'CbCr<=>RGB conversion , matrix, sampling algorithm, etc.. IMO, Easiest way to get out of this mess for video levels out of vegas is debugmode frameserver . RGB is RGB, and you can control everything in avisynth - you're not limited to vegas' bloody mess, and you only incur 1 RGB=>Y'CbCr conversion . You have full control instead of trying to "guess" WTF vegas is doing and try codecs until something works


    My guess is that x264, xvid, ffdshow, all have some sort of internal conversion going on that you can't turn off...or that I don't know how to turn off. I tried forcing different input colorspaces, but this resulted in an error from vegas when trying to encode. No luck. forcing an output colorspace like YUY2 vs YV12 yeilded no improvement.
    Typically these are all Y'CbCr (you can configure x264 to encode RGB, or other things like Y'CbCr 4:4:4, 4:2:2, but they typically aren't used). The problem is you don't know what vegas is handing off to that encoder


    With the mjpeg option, I don't quite understand regarding it expanding the levels to 255 full range, etc...shouldn't that make it brighter, not darker?
    Normal range Y'CbCr data, decoded at normal range, standard Rec601/709 matrix when converting to RGB is perfect => this is what normally happens in youtube or everything else

    If you have full range Y'CbCr data, then decoding at full range, converting to RGB at full range (full range matrix) is also perfect.

    If you have full range Y'CbCr data, then decoded at full range, but a standard Rec601/709 matrix is used when converting to RGB, contrast will be strectched, and dark and bright ends will be clipped/crushed

    =>*** the bottom line is youtube uses standard Rec601/709 matrix when converting to RGB for display (according to those HW on/off rules above). If you use mjpeg, it decodes at full range (so the re-encoded video is at full range), but only Y'16-235 of that data gets converted to 0,0,0-255,255,255 RGB when displayed . Thus Y' 0-15, 236-255 are gone. Because mjpeg is decoded at full range, in order to display full range Y'CbCr data properly, you need to use a full range matrix (you can do this with flash and flags with your own website, but youtube re-encodes and ignores flags)




    I did notice the ability to use RGB 32 floating point in Vegas project settings. Is it better to use Video levels or full range?
    The 32bit/8bit options affect Y'CbCr video assets, how the conversion to RGB is done on the timeline.


    If you're starting with RGB still image - it doesn't affect you. Simply put, RGB is RGB (no conversion is done. Remember, all these levels problems you're having are because of RGB<=>Y'CbCr conversions) . However, unless you export a RGB format, you convert to Y'CbCr somewhere (e.g. xvid , mpeg2 ... all these distrubution formats are Y'CbCr, not RGB) . 32bit processing is much slower , but you may benefit for some types of effects, color correction (intermediate calculations are more precise, a bit less banding introduced)
    Last edited by poisondeathray; 16th Jan 2013 at 14:37.
    Quote Quote  
  17. Originally Posted by poisondeathray View Post

    Are you talking big differences, or just tiny audiophile-can-only-tell differences?
    Noticeable differences. It also depends on the quality of audio processor your computer is using. I use a reference grade sound card, so as part of my audio testing I also have a few people who use integrated sound test the audio as well, from a listening standpoint. When it comes to XDCam, everyone can hear a difference between that and AVI. A difference can be heard between Sony AVC and Mainconcept AVC, as well as XDCAM with EQ and AVC. This was all on integrated audio, which most people are using. Some couldn't hear a difference between QT and AVI. I can. Mostly those with superior sound systems could tell. Though my channel has a lot of audiophile viewers for the very reason that I pay attention to the audio quality, so it's important to me to continue to deliver that.


    Read those Glen Chan articles if you want more info. You cannot access where/how what vegas is doing at that export stage. You just have to do a lots of tests . That's why Exporting out RGB out of vegas and using another program will give you full control.
    Here is my concern. I am okay using meGUI or any other program to do the video conversion as long as the colors come out right. But my concern is over the audio. Using the Bubblevision guide a long time ago, I tried using meGUI with NeroAAC and such to produce videos. I also tried Handbrake. Unfortunately in these situations I wound up with lossy audio, not lossless, which sounded inferior to the lossy AAC audio of AVC. So can you tell me how I would go about keeping my audio intact? Plus, I use EQ on a lot of tracks using the Vegas EQ tool. I'd want to preserve those EQ adjustments losslessly as if I had rendered an AVI straight out of vegas.

    I saw this Cedocia program mentioned in that linked thread. could this program do what I'm trying to do? Sounds like it has decent color control as well.

    The rest of your post made sense. I'd like to address more but must get to my next class. Back in a couple hours.
    Quote Quote  
  18. Originally Posted by Fox_720 View Post
    Originally Posted by poisondeathray View Post

    Are you talking big differences, or just tiny audiophile-can-only-tell differences?
    Noticeable differences. It also depends on the quality of audio processor your computer is using. I use a reference grade sound card, so as part of my audio testing I also have a few people who use integrated sound test the audio as well, from a listening standpoint. When it comes to XDCam, everyone can hear a difference between that and AVI. A difference can be heard between Sony AVC and Mainconcept AVC, as well as XDCAM with EQ and AVC. This was all on integrated audio, which most people are using. Some couldn't hear a difference between QT and AVI. I can. Mostly those with superior sound systems could tell. Though my channel has a lot of audiophile viewers for the very reason that I pay attention to the audio quality, so it's important to me to continue to deliver that.
    I'm wondering if this is a recent development with uncompressed audio? Or were these tests done long time ago ? When did you conduct these tests ?

    I know the AAC audio bug is fairly recent, and even "normal" people can tell


    Here is my concern. I am okay using meGUI or any other program to do the video conversion as long as the colors come out right. But my concern is over the audio. Using the Bubblevision guide a long time ago, I tried using meGUI with NeroAAC and such to produce videos. I also tried Handbrake. Unfortunately in these situations I wound up with lossy audio, not lossless, which sounded inferior to the lossy AAC audio of AVC. So can you tell me how I would go about keeping my audio intact? Plus, I use EQ on a lot of tracks using the Vegas EQ tool. I'd want to preserve those EQ adjustments losslessly as if I had rendered an AVI straight out of vegas.
    For the video - it's going to depend how you have vegas setup. Most guides assume you are using video assets, 8bit mode, video levels . Vegas is using "studio RGB" for that conversion (That's why most guides will tell you to use the "PC" matrix when using ConvertToYV12) . If you have a still image only project, this will be RGB, not Y'CbCr video. Thus when you frameserve RGB, you only need the "Rec" matrix

    For the audio - since you're very audio oriented - I would continue to use lossless audio (uncompressed pcm wave) . You can either export that from vegas, or if you use audio in debugmode, you can use soundout() to export the audio, or even something like vdub. You can mutliplex video & audio for uploading to youtube with mkvmerge for example

    As an aside, vimeo supports 48Khz audio now, I don't know what you're views are on 44.1Khz vs. 48Kz. And another aside - if you use blip.tv, and use FLV container (e.g. you can re-wrap into FLV), it won't re-encode the audio or video (ie. you can stream the original video) - so you can use high bitrate AAC for example, and you won't incur the loss that something like YT or vimeo cause when they re-encode

    Another aside - youtube allocates higher bitrate audio for higher resolution video. Eg. 1080p versions get more audio bitrate than 720p versions

    I saw this Cedocia program mentioned in that linked thread. could this program do what I'm trying to do? Sounds like it has decent color control as well.
    cedocida is a dv codec, you don't want to use this
    Quote Quote  
  19. Okay, I am back.

    So after reading the articles, what I'm gathering is that with AVC, the encoder was expecting Studio RGB levels, and that's what I gave it using the Computer RGB to Studio RGB adjustment. It then put out a file that was brighter than the original PNG image, but once uploaded to Youtube, that was converted back to a level nearly identical to the original PNG.

    Youtube's handling of MJPEG is flawed from the start, however, and so I'm advised not to use that format. Okay. I do notice the same problem when using FFV1 and Huffyuv vfw through ffdshow, also.

    I played with Gamma, and while I can get the brightness to look right, all of the contrast is wrong...details in shadows and highlights are elminated with the use of Gamma, so that's not an adequate solution.

    So I guess my next step is to try to frameserve out of vegas and into something like MeGUI, encode an audioless video, and try to find out what color combination produces an adequate result on Youtube.

    Once I figure that out, I need to get my lossless audio into the video file. I am concerned about making an mkv though, since youtube handles different containers differently, I wonder if the mkv will sound different than a straight AVI. The goal is to get an AVI with uncompressed audio and audio adjustments with a video that looks natural on youtube.

    I'll play around with a GUI for a while and likely come back with more questions, but thank you for your help so far. It's greatly appreciated. It's frustrating to have to do this, but I'm learning more about video encoding than I've ever really known at this stage.
    Quote Quote  
  20. Originally Posted by Fox_720 View Post

    So after reading the articles, what I'm gathering is that with AVC, the encoder was expecting Studio RGB levels, and that's what I gave it using the Computer RGB to Studio RGB adjustment. It then put out a file that was brighter than the original PNG image, but once uploaded to Youtube, that was converted back to a level nearly identical to the original PNG.
    That's basically right. After the studio RGB filter is applied, there is another conversion to Y'CbCr and subsampling to 4:2:0 when you export to AVC (it's done "behind the scenes" in vegas, you have no control over it) . That AVC video has levels unchanged in youtube when it gets decoded and re-encoded by youtube.

    If you are seeing a difference in an AVC encoded video before uploading to youtube, vs. the youtube version of that, it indicates something isn't calibrated on your system correctly (either graphics card, renderer, some setting in your media player.. it can be many , many things) . (Don't use vegas to "test" the exported video, because it will use studio RGB for the conversion)


    Youtube's handling of MJPEG is flawed from the start, however, and so I'm advised not to use that format.
    I don't know if I'd call it "flawed" , because most mjpeg decoders don't clamp to legal levels, they output full levels. Anyways....just nitpicky semantics

    Okay. I do notice the same problem when using FFV1 and Huffyuv vfw through ffdshow, also.
    It's hard to say what's causing that, because vegas does a few things behind the scenes. You're not sure what's being handed off to the codec. If you did a test video in vdub and used "fast recompress" you avoid colorspace conversions - if you did those tests you will notice levels are unchanged if you download youtube's re-encoded video and look with a waveform monitor. Unless something has changed in the last month or so, I'm certain FFV1 Y' levels are passed through

    So I guess my next step is to try to frameserve out of vegas and into something like MeGUI, encode an audioless video, and try to find out what color combination produces an adequate result on Youtube.
    I'm certain if you stay in RGB until the very end, this will work. It's the Y'CbCr<=>RGB conversions vegas is doing (and the ones it's doing behind the scenes) that is causing your problems

    Once I figure that out, I need to get my lossless audio into the video file. I am concerned about making an mkv though, since youtube handles different containers differently, I wonder if the mkv will sound different than a straight AVI. The goal is to get an AVI with uncompressed audio and audio adjustments with a video that looks natural on youtube.
    DOH! Ahhh good point... The problem is AVI container can have issues with b-frames when being decoded (you might get sync issues, and or black or green frames). If you encode without b frames (loss of compression efficiency) it shouldn't be a problem
    Quote Quote  
  21. Huffyuv, Xvid, Divx and ffdshow all convert RGB to YUV with the rec.601 matrix (RGB 0-255 --> YUV 16-235) if given RGB. Conversely, they all use the rec.601 matrix to convert YUV to RGB (YUV 16-235 --> RGB 0-255) -- unless a different matrix is specified in the encoded video (MPEG, AVC, etc.). If they are given YUV there is no conversion and hence no levels change. Whether the codecs receive or output RGB depends on what was negotiated between the codec and the editor.

    Since your video is predominantly green, you will see a difference in apparent brightness between rec.601 and rec.709 conversions (mostly visible in bright reds and greens). Some programs default to rec.709 for high def video, rec.601 for standard def video.

    https://forum.videohelp.com/threads/329866-incorrect-collor-display-in-video-playback?p...=1#post2045830

    Once again, you cannot trust what you see in a media player or web browser unless you have calibrated your graphics card's video proc amp. If you use VLC with the output device set to Windows GDI you can be assured the conversion to RGB is with a rec.601 matrix (actually, it may use rec.709 for unflagged high def, I'll have to check).

    I don't use Vegas but from what I hear what you see on-screen depends on what type of video you're opening. Use the programs built in waveform monitor to check levels. That's much more reliable than viewing the video.
    Last edited by jagabo; 16th Jan 2013 at 19:33.
    Quote Quote  
  22. Okay, I have an update!

    After frameserving in RGB24 to MeGUI, I tested a few AVS scripts and the following worked:

    ConvertToYV12(interlaced=false, matrix="Rec709")

    This produced a video that was nearly identical colorwise to the original. What differences there were were probably due to compression or some other MeGUI setting. So at least I know through MeGUI I can fix the color accurately. This was using the XVid encoder, as well.

    Now the question is how to get my uncompressed audio into the file. I see an option in MeGUI for encoding with FLAC, which is lossless, but FLAC doesn't play nice with Youtube per prior experience. How do I get my audio into the file without MeGUI recompressing it in any way?
    Quote Quote  
  23. If you frameserved RGB (from an RGB asset only project in vegas), and you think the colors were almost identical, that suggests you were using Rec709 to convert back to RGB (for display) in the viewing application

    Well I suggested mkvmerge, but you can re-wrap into avi with ffmpeg . (I seriously don't understand why the same audio in one container vs. another would make a difference... You might test mkv anyway, it might sound better than the AVI container tests you did earlier ? )

    ffmpeg -i input.mkv -vcodec copy -acodec copy output.avi

    As mentioned earlier - Youtube might have problems with b-frames in AVI (sync, green frames), so unless you specified no b-frames during encoding....


    Also you will get the Rec601 vs. Rec709 color shift from youtube according to those client HW on/off rules above. Those with HW on always use Rec601 matrix (so your video colors will look slightly "off" since you are using Rec709) . There is no way to make it look perfect for all viewers on youtube ( if you use your own flash implementation you can make it look "perfect" for all viewers, by using flags)
    Quote Quote  
  24. Originally Posted by poisondeathray View Post
    If you frameserved RGB (from an RGB asset only project in vegas), and you think the colors were almost identical, that suggests you were using Rec709 to convert back to RGB (for display) in the viewing application

    Well I suggested mkvmerge, but you can re-wrap into avi with ffmpeg . (I seriously don't understand why the same audio in one container vs. another would make a difference... You might test mkv anyway, it might sound better than the AVI container tests you did earlier ? )

    ffmpeg -i input.mkv -vcodec copy -acodec copy output.avi

    As mentioned earlier - Youtube might have problems with b-frames in AVI (sync, green frames), so unless you specified no b-frames during encoding....


    Also you will get the Rec601 vs. Rec709 color shift from youtube according to those client HW on/off rules above. Those with HW on always use Rec601 matrix (so your video colors will look slightly "off" since you are using Rec709) . There is no way to make it look perfect for all viewers on youtube ( if you use your own flash implementation you can make it look "perfect" for all viewers, by using flags)
    Oh, sorry, I should have specified: The Rec709 encode looks correct after I upload it to youtube. I compared it with the AVC youtube upload. Colors match. Theoretically, I would guess that the colors would match the AVC video for display on other computers as well, if they match in the browser. Correct? On my computer itself, it looks slightly brighter than the original, the same as the AVC does. (It looks oversharp on my PC as well, but I think that's more to do with the meGUI preview window, because it is not oversharp on YT)

    I will go ahead and give MKVmerge a try and see how it sounds. And yeah, I don't understand why different containers can yeild different results, but the spectrum analysis reveals the discrepancy.
    Quote Quote  
  25. Originally Posted by Fox_720 View Post

    Oh, sorry, I should have specified: The Rec709 encode looks correct after I upload it to youtube. I compared it with the AVC youtube upload. Colors match. Theoretically, I would guess that the colors would match the AVC video for display on other computers as well, if they match in the browser. Correct? On my computer itself, it looks slightly brighter than the original, the same as the AVC does. (It looks oversharp on my PC as well, but I think that's more to do with the meGUI preview window, because it is not oversharp on YT)
    For youtube - do you have HW acceleration "off" in flash? - It only matches because it's off. If you turn it "on" it shouldn't match . Viewers that have HW "on" will view it using Rec601 (but you converted to YV12 using Rec709)

    Most mediaplayers will use Rec709 (to convert back to RGB for display) if the width is larger than a certain dimension (threshold value for HD). The reason is Rec709 is supposed to be used for HD, Rec601 for SD

    When you use a certain matrix for RGB<=>Y'CbCr, you have to use the same matrix to revert back - that's how you get the same colors. When there is a mismatch, that's when you get trouble and colors aren't represented correctly (color shifts)

    Flash doesn't follow those rules, that why you get all these color issues on youtube (which doesn't obey flags)

    Flash uses "cheap" chroma sampling (point resampling algorithm). Colors edges will look blocky and pixellated compared to a preview in a media player or megui
    Quote Quote  
  26. I can't comment on you computer view experience, where the avc video looks "brighter" because there are a dozen diffeent things that can contribute to that (renderer setting, renderer choice, graphics card settings, matrix used when converting back to RGB, calibration....) . If yo u have everything calibrated correctly, then viewing the Rec709 YV12 exported video should look the same as the original (in terms of color)

    Attached are some examples of what you *should* be seeing if everything is calibrated

    0 - This is the original RGB
    1 - This is converted to YV12 using Rec709, but viewed with Rec601 (ie. converted back to RGB with Rec601)
    2 - This is converted to YV12 using Rec709, but viewed with Rec709 (ie. converted back to RGB with Rec709)


    Notice (1) color is shifted, the green appears "brighter" and the hue is shifted. But as said earlier, the black and white point is unchanged - it's not the "levels" issue that you had with mjpeg where "black" wasn't "black" . This is also what you should see if you have HW acceleration "on" for Youtube

    (2) looks almost the same as original, the difference is the fine text isn't as clear or crisp. But otherwise the colors are the "same". The color loss in "crispness" is due to chroma subsampling. The color information has been reduced when subsampling to 4:2:0 . RGB is full color and unsubsampled. Remember I mentioned colorspace conversions were lossy , and additive? You want to minimize "trips" betweeen RGB<=>Y'CbCr because the losses will compound
    Image Attached Files
    Quote Quote  
  27. Okay, I checked the hardware acceleration settings for Flash. They were "on".

    I then loaded up both videos side by side, and turned off the hardware accelleration for both. They still match each other for the most part, except for different patterns of compression artifacts. I then turned the HW acceleration off for one video, and kept it on for the other. Again, they are very, very close.

    So then I went and re-encoded a new video using Rec601. It came out darker, though less "messy" than the original mjpeg videos I tried. Here are some screenshots taken with hardware acceleration on. I have not resized these:

    Youtube AVC:


    MeGUI AVI with Rec709


    MeGUI AVI with Rec601
    Quote Quote  
  28. Originally Posted by Fox_720 View Post
    Okay, I checked the hardware acceleration settings for Flash. They were "on".

    I then loaded up both videos side by side, and turned off the hardware accelleration for both. They still match each other for the most part, except for different patterns of compression artifacts. I then turned the HW acceleration off for one video, and kept it on for the other. Again, they are very, very close.
    This is different than how it used to be - It might be something has changed in flash handling, or it might be youtube specific change. It used to be as stated above with HW on vs. off . I'll look into it in more detail if I have chance later .

    Well it looks like you have that part figured out and Rec709 should work for both HW on/off cases . Now on to the *weird* audio issues...
    Quote Quote  
  29. If you're still wanting AVI output, and you already have an AVI that you are happy with , and just want add in uncompressed audio track, you can use avimux-gui, or vdub (video=>direct stream copy, audio=>audio from other file) . When using AVI, recommended you disable b-frames because of decoding issues (but loss of compression efficiency or quality at a given bitrate, but if you use adquate bitrate it will be fine)

    If you have it mkv or other container you can use ffmpeg to re-wrap it into AVI using the command line posted earlier
    Quote Quote  
  30. Fantastic! After work I will give it a try, and let you know what worked best. Thank you for your continued assistance, it is much appreciated.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!