VideoHelp Forum




+ Reply to Thread
Results 1 to 20 of 20
  1. Hi guys,

    First of all, happy holidays to everyone.

    Iīd like to share with you my experience and the problems Iīm having when
    encoding video, and also hope the solution to this can help other people.

    I have a problem when rendering video as uncompressed AVI. The output video
    comes out too bright. What I want to do is converting Mpeg-2 *.PS files captured
    with my tuner card (or any other type of video in the future) to Mp4/x264. I tried
    this with Staxrip and MeGUI, and the result is very good, BUT every video I edited
    with both of these front-ends in order to remove some scenes, came out with the
    audio out of sync, even though I used CBR Mp3. Is there a way to solve this
    syncing problem? If so, Iīd stick with these little programs.

    Iīve seen that many people use Vegas to edit and then export to uncompressed
    AVI, perhaps to overcome this problem... so, Iīm giving a try to Vegas which
    seems to edit very nicely without the syncing problem. BUT, all videos come out
    bright, not only in Vegasī Preview (best quality chosen) window but when exported
    to uncompressed AVI; brighter than the original video. And then when I compress this
    AVI with Staxrip or MeGUI, the output video is also bright. I didnīt touch any filters,
    etc., all by default. I also tried Magix Movie Edit to compare, and its preview is good,
    BUT the uncompressed AVI also comes out bright.

    I tried the AVC codecs in Vegas, Mainconcept AVC and Sony AVC, and the result is good,
    not bright at all, although the preview is also bright. But these codecs compression is
    not so good even with higher bitrates. Curiously, the Mainconcept AVC in Movie Edit,
    give a bright video too.

    Oh, and something surprising: if I import in Vegas the uncompressed AVI rendered with
    it, and then render it again with Mainconcept AVC, the result is good too. Weird... I donīt
    understand whatīs lost here and why this brightness problem.

    Iīve tried different lossless codecs, Lagarith, Huffyuv, etc., and most of them render bright
    but 2, which did it fine, not bright, Sony YUV and Intel 4.2.0, BUT when this AVI is loaded
    either in Staxrip or MeGUI, I get some sort of error, they canīt open the video, or index it.
    MeGUI reports it canīt open it and recommends to install a YV12 codec, but I have it
    already installed, YUVsoft's and some other, I think.

    I play back the videos with VLC and Media Player Classic. Both show same picture
    quality.

    So, what is this brightness problem, amd why most codecs canīt output the video
    with its original picture quality, and what can I do to solve it, what codec should I
    use that, like Sony YUV, doesnīt add brightness and at the same time can be
    opened and encoded fine with Staxrip and MeGUI?

    These two frontends encode fine the original Mpeg-2 *.PS files without this brightness,
    BUT their editing capability seems very bad.

    Thanks in advance.

    Cheers.
    Quote Quote  
  2. There should be no difference in brightness with the different codecs. You have some other processing problem. In all likelihood a disagreement between whether to use PC.601 (or PC.709) or rec.601 (or rec.709) conversions between RGB and YUV. The rec matrices include contrast expansion going from YUV to RGB, the PC matrices don't. Conversely, the rec matrices use contrast contraction when going from RGB to YUV, the PC matrices don't.
    Quote Quote  
  3. Hi jagabo,

    Thanks for your reply.

    I donīt understand what the processing problem you mention is.
    Could you please give some more detail or rather tell me what
    to do to fix the problem? I just want the converted video with
    any LOSSLESS codec to look as the original when played back
    with VLC or any other player.

    Thanks.

    Cheers.
    Quote Quote  
  4. This problem has been answered many times

    The short answer is vegas in 8-bit mode for most video types, it does it's RGB conversion using studio rgb (Y'CbCr gets converted to RGB 16-235, instead of the 0-255 that every other program uses. So black is at 16,16,16, and white is at 235,235,235 which is very atypical for RGB). If you use 32-bit mode, you will notice the preview less washed out (because the conversion is using "computer RGB" or converted to 0-255 now). You should read these articles for more information. They tell you everything and what to do about it
    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


    If you're only doing cut type editing, vegas will "smart render" mpeg2 ps (.mpg, .mpeg). Smart rendering means untouched segments are passed through. This means no RGB conversion or quality loss. Only segments like transitions or global effects (like color correction need re-rendering). You actually lose more quality by exporting RGB uncompressed avi because of the extra colorspace conversion (and when you have to convert back to YV12 in the other encoding program). Smart rendering is similar to womble or videoredo does - alternatively, you could use those programs to do your cuts. In vegas, the export template has to match the same video characteristics to activate it. If you see "no recompression required" as it renders you know you have it set up correctly. Look at the manual for more information

    Another approach is to do your cuts in avisynth using trim(). Your sync issues were probably from not using an indexed or frame accurate script (perhaps you used something like directshowsource() )
    Quote Quote  
  5. Hi,

    Oh well, the problem seems to be very tricky... I was expecting
    a simple solution like "just use this codec..." or "just tick this
    option there...". Anyway, Iīll have a look at these links you
    just gave me. I hope I can understand any solution provided
    there and be able to solve this important and so frustrating
    problem.

    Thanks once again for your help and time.

    Cheers.
    Quote Quote  
  6. If you're only doing cutting (e.g. cutting commercials out) , the simple solution is to use smart rendering (export mpeg2).

    Better quality (because untouched segments are passed through), faster, smaller filesizes (uncompressed RGB is huge). Once it's edited, then use megui , staxrip or whatever x264 GUI to encode

    If you're doing other types of editing, then read those links and start learning about color spaces.

    Cheers
    Quote Quote  
  7. Hi jagabo,

    After reading the guides on colour spaces, I tried the Studio RGB to Computer RBG
    filter in Vegas and it fixed the bright picture of my Mpeg-2 *.PS clips. Hmm, I donīt
    understand why a top software such as Vegas doesnīt do it automatically, itīs
    shocking. Anyway, I suppose the filter is there for an important reason. I havenīt
    had the time yet to compare well the output with this filter against the original
    video clip, but I guess I shouldnīt touch this preset at all. I just want the closest
    picture quality to the original clip.

    Sorry if I ask too much, but I need to clarify some small details, if you donīt mind:

    Iīve opened another Mpeg-2 clip in Vegas which is PAL too, but this one has
    the commercials in 16:9 format but the TV show is in 4:3. Vegas previews the
    show with black bars and the render comes out also with those. I tried to set
    the project to PAL 4:3, but no change. What do I have to do to change the
    format to 4:3? Perhaps itīs not because of the 16:9 parts of the video... I may
    miss something.

    Does an uncompressed AVI video lose any quality if exported again to
    uncompressed AVi just to add this RGB filter? I have 3 of these bright
    AVIs Iīd like to convert now properly; the source files were deleted.

    Do you know if Movie edit pro has this type of filter or workaround for this
    brightness issue? It also exports bright though the preview is not so
    bright.

    What DAR (Display Aspect Ratio) should I set for a PAL 4:3 (720x576) video?
    In Staxrip, if I choose 4:3 (1.333), it gives a 768x576 resolution, which I like
    best since it is not so wide as others. And it is the DAR that VLC shows
    when playing back the original *.PS files. I fear a wider one could stretch
    or distort the picture. Is it correct? Wider would distort the picture?

    And, lastly, how do you set the output DAR in MeGUI? If I select 4:3 (1.333) in
    the "Input DAR" window, I get 720x576...

    Thank you once again for all your help

    Cheers.
    Quote Quote  
  8. Originally Posted by vidqual View Post
    After reading the guides on colour spaces, I tried the Studio RGB to Computer RBG
    filter in Vegas and it fixed the bright picture of my Mpeg-2 *.PS clips. Hmm, I donīt
    understand why a top software such as Vegas doesnīt do it automatically, itīs
    shocking. Anyway, I suppose the filter is there for an important reason. I havenīt
    had the time yet to compare well the output with this filter against the original
    video clip, but I guess I shouldnīt touch this preset at all. I just want the closest
    picture quality to the original clip.
    The benefit of studio RGB is your 'brighter than bright' highlights and 'darker than dark' shadows are preserved. In Y'CbCr space , Y<16 and Y>235 is perserved. Conventional RGB conversion using BT601 or BT709 will clip those. There are pros/cons to either method


    Iīve opened another Mpeg-2 clip in Vegas which is PAL too, but this one has
    the commercials in 16:9 format but the TV show is in 4:3. Vegas previews the
    show with black bars and the render comes out also with those. I tried to set
    the project to PAL 4:3, but no change. What do I have to do to change the
    format to 4:3? Perhaps itīs not because of the 16:9 parts of the video... I may
    miss something.
    Are you keeping the commercials? Just cut them out and keep 4:3 ? or You can try restream or dvd patcher to flag the stream, or right click in the clip bin and interpret the file AR


    Does an uncompressed AVI video lose any quality if exported again to
    uncompressed AVi just to add this RGB filter? I have 3 of these bright
    AVIs Iīd like to convert now properly; the source files were deleted.
    No additional compression losses, and no colorspace losses if the uncompressed AVI was in RGB space . If you have YV12 uncompressed AVI, then there will be a tiny bit of quality loss from the colorspace conversions

    Do you know if Movie edit pro has this type of filter or workaround for this
    brightness issue? It also exports bright though the preview is not so
    bright.
    No idea, I don't use it



    What DAR (Display Aspect Ratio) should I set for a PAL 4:3 (720x576) video?
    In Staxrip, if I choose 4:3 (1.333), it gives a 768x576 resolution, which I like
    best since it is not so wide as others. And it is the DAR that VLC shows
    when playing back the original *.PS files. I fear a wider one could stretch
    or distort the picture. Is it correct? Wider would distort the picture?

    And, lastly, how do you set the output DAR in MeGUI? If I select 4:3 (1.333) in
    the "Input DAR" window, I get 720x576...
    By 768, do you mean it's encoded the frame size as 768 or it displays as 768 in a media player ?

    I use the custom command line or CLI. Not sure how megui or staxrip handles it through the GUI

    For PAL 4:3 you would enter --sar 12:11 or --sar 16:15

    12:11 is based on 704width , and 16:15 is based on 720w . Technically, 12:11 is more correct
    Quote Quote  
  9. s PAL too, but this one has
    the commercials in 16:9 format but the TV show is in 4:3. Vegas previews the
    show with black bars and the render comes out also with those. I tried to set
    the project to PAL 4:3, but no change. What do I have to do to change the
    format to 4:3? Perhaps itīs not because of the 16:9 parts of the video... I may
    miss something.


    Are you keeping the commercials? Just cut them out and keep 4:3 ? or You can try restream or dvd patcher to flag the stream, or right click in the clip bin and interpret the file AR

    Iīm just keeping the TV show which is in 4:3. OK, Iīll have a look at the fileīs AR and delete
    the commercials to see what happens. I opened this clip in Movie Edit and it read it as 16:9
    but asked if wanted to adjust it to the actual project template, 4:3, and it did it very well.
    So I edited there and exported as uncompressed AVI, then loaded it in vegas to add the RGB
    filter. This was another reason why I asked about the recompression of the uncompressed AVIs.
    But Vegas didnīt ask anything, even though I opened a PAL 4:3 template; it just displayed
    it as 16:9.



    What DAR (Display Aspect Ratio) should I set for a PAL 4:3 (720x576) video?
    In Staxrip, if I choose 4:3 (1.333), it gives a 768x576 resolution, which I like
    best since it is not so wide as others. And it is the DAR that VLC shows
    when playing back the original *.PS files. I fear a wider one could stretch
    or distort the picture. Is it correct? Wider would distort the picture?

    And, lastly, how do you set the output DAR in MeGUI? If I select 4:3 (1.333) in
    the "Input DAR" window, I get 720x576...

    By 768, do you mean it's encoded the frame size as 768 or it displays as 768 in a media player ?
    I mean the display the player shows. The video is encoded as its original resolution, 720x576.
    I donīt change its size. Since Iīve seen many different DARs, and resolution ratios, Iīm not
    sure what size to choose, but what I know is that I donīt want a distorted picture. Example:
    The program of my tuner card reports a 720x576 4:3 resolution, BUT when I play back the
    recorded video in VLC, I see that the actual size of the picture is slightly different. For a PAL
    4:3 stream it is 768x576 (VLCīs screen capture tells me). So for a novice this is confusing.
    If VLC displays this DAR, I suppose it is because the stream has this DAR flag. With some
    tests I did some time ago with Staxrip I got wider resolutions like 785x576... I donīt know,
    but it seems to me that wider resolutions may look distorted.

    Thanks!

    Cheers.
    Quote Quote  
  10. Displaying as 768x576 on a pc is correct for that PAL AR. In square pixels, 768/576 = 4/3 exactly

    Use the instructions above with the --sar x:y and it will give you the correct display in all media players and devices
    Quote Quote  
  11. Originally Posted by poisondeathray View Post
    Displaying as 768x576 on a pc is correct for that PAL AR. In square pixels, 768/576 = 4/3 exactly

    Use the instructions above with the --sar x:y and it will give you the correct display in all media players and devices

    Hi,

    Thanks. I just did a test, and this is the result:

    --sar 12:11 = 785x576
    --sar 16:15 = 768x576

    So I think Iīll use --sar 16:15 from now on when using MeGUI.
    This same sar will work best also for 16:9 and any format, right?

    Regarding the Vegas issue displaying the 16:9/4:3 clip as 16:9 only,
    I found an easy solution. You have to uncheck "Maintain Aspect Ratio"
    in the menu Edit/Switches.

    Iīm now tryng to find the best x264 preset in MeGUI for best
    quality and minimum file size. I tried 3-pass and Film which I
    guess will give better quality. What preset do you use or
    rather what configuration for best quality?

    Cheers.
    Quote Quote  
  12. Originally Posted by vidqual View Post
    --sar 12:11 = 785x576
    --sar 16:15 = 768x576
    There have been several big discussion about this over the years. For example:

    https://forum.videohelp.com/threads/327702-Is-704x480-with-a-16-9-DAR-valid-for-DVD

    DVDs contain no pixel aspect ratio (SAR in x264 terms) information -- only the final display aspect ratio (DAR). If you follow the traditional ITU BT.601 specification the pixel aspect ratio is 12:11. But the MPEG specification implies the pixel aspect ratio is 16:15 for DVD. As far as I can tell, some DVDs follow the ITU spec, some follow the MPEG spec. In any case, you probably won't notice the ~2 percent difference.
    Quote Quote  
  13. Originally Posted by jagabo View Post
    Originally Posted by vidqual View Post
    --sar 12:11 = 785x576
    --sar 16:15 = 768x576
    There have been several big discussion about this over the years. For example:

    https://forum.videohelp.com/threads/327702-Is-704x480-with-a-16-9-DAR-valid-for-DVD

    DVDs contain no pixel aspect ratio (SAR in x264 terms) information -- only the final display aspect ratio (DAR). If you follow the traditional ITU BT.601 specification the pixel aspect ratio is 12:11. But the MPEG specification implies the pixel aspect ratio is 16:15 for DVD. As far as I can tell, some DVDs follow the ITU spec, some follow the MPEG spec. In any case, you probably won't notice the ~2 percent difference.
    OK, 16:5 looks better to me.

    Iīm trying right now exporting a PAL 16:9 clip as uncompressed AVI in Vegas, but
    even though the project and preview are fine, 16:9 without black bars, it comes out
    as 4:3... Hmm, hope I can sort it out by tomorrow night.

    Cheers.
    Quote Quote  
  14. Originally Posted by vidqual View Post
    Iīm trying right now exporting a PAL 16:9 clip as uncompressed AVI in Vegas, but
    even though the project and preview are fine, 16:9 without black bars, it comes out
    as 4:3...
    The AVI container doesn't really support aspect ratio flags. You just have to tell the editing application that opens the AVI file what the aspect ratio is.
    Quote Quote  
  15. Yes, uncompressed AVI should come out as 5:4 or 1.25, not 4:3 . (because in square pixels 720/576 = 1.25 , not 1.33)

    As jagabo says , you tell the encoder or application what to do with it (e.g. use --sar x:y in x264 , set the AR in the mpeg2 encoder, or interpret the file AR in your editor)
    Quote Quote  
  16. Originally Posted by poisondeathray View Post
    Yes, uncompressed AVI should come out as 5:4 or 1.25, not 4:3 . (because in square pixels 720/576 = 1.25 , not 1.33)

    As jagabo says , you tell the encoder or application what to do with it (e.g. use --sar x:y in x264 , set the AR in the mpeg2 encoder, or interpret the file AR in your editor)

    Oh, I see, I understand now... uncompressed AVI is like a raw format. Thatīs why the PAL 4:3
    clips also had no DAR, their display were all 720x576, their size resolution. And sorry I said
    4:3, I didnīt actually check it properly.

    I did a few tests with this PAL 16:9 AVI. In Staxrip you have to select DAR 16:9. The encoding
    comes out perfectly as 1024x576, the same DAR that VLC displays, so Iīm happy

    I also tried this PAL 16:9 AVI clip in MeGUI with both SAR lines you guys gave me (--sar 16:15
    and --sar 12:11) BUT the output were both in 4:3, 768x576 and 785x576, the same as with a
    PAL 4:3 clip. I then tried the DAR input of the GUI, which worked well. "PAL 16:9 (1.777778)"
    gave the desired 1024x756.

    So, Iīll use the "--sar 16:15" CLI line for PAL 4:3 clips (the GUI DARs give slightly different ones
    but not 768x576), and the GUI for 16:9 clips.

    Now I only need to find the best x264 preset for maximum quality and minimun file size.

    OK, so now Iīm ready to edit my clips as I want, with their correct colour space, export them
    and encode them with the correct aspect ratio, and best quality is coming!

    Thank you once again for your time and help.

    And happy new year to you, and of course to all the VideoHelp community!

    Cheers.
    Quote Quote  
  17. You can look at the encode log to see what --sar x:y value the gui is passing

    These are the sar values for SD (depending which standard you go by - i.e. if you want 704w or 720w). It's just simple math.

    NTSC 4:3 => sar 10:11 (or 8:9)
    NTSC 16:9 => sar 40:33 (or 32:27)
    PAL 4:3 => sar 12:11 (or 16:15)
    PAL 16:9 => sar 16:11 (or 64:45)

    There is no generic preset for "maximum quality." You would use different settings on different types of content. For example, in general you would encode cartoons using different settings than live action. The other part of the puzzle is pre-processing (i.e. using filters). This is usually more important than encoding settings, depending on the source of course.
    Quote Quote  
  18. Originally Posted by poisondeathray View Post
    You can look at the encode log to see what --sar x:y value the gui is passing

    These are the sar values for SD (depending which standard you go by - i.e. if you want 704w or 720w). It's just simple math.

    NTSC 4:3 => sar 10:11 (or 8:9)
    NTSC 16:9 => sar 40:33 (or 32:27)
    PAL 4:3 => sar 12:11 (or 16:15)
    PAL 16:9 => sar 16:11 (or 64:45)

    There is no generic preset for "maximum quality." You would use different settings on different types of content. For example, in general you would encode cartoons using different settings than live action. The other part of the puzzle is pre-processing (i.e. using filters). This is usually more important than encoding settings, depending on the source of course.

    Thanks for the new SARs; Iīll try them all.

    Regarding the encoding quality, Iīll have a look around to see what people use.


    Cheers.
    Quote Quote  
  19. Originally Posted by vidqual View Post
    Thanks for the new SARs; Iīll try them all.
    Note that it's not a matter of trying different SARs to see which ones come out to 1024x576 or 768x576. We already know that (720x16/15=768, 720x64/45=1024). The issue is whether the 4:3 or 16:9 picture on a DVD is represented by the full 720x576 frame or a 704x576 subsection. If the latter, the full 720x576 frame represents an image wider than 4:3 or 16:9. There are conflicting opinions on this.
    Quote Quote  
  20. Originally Posted by jagabo View Post
    Originally Posted by vidqual View Post
    Thanks for the new SARs; Iīll try them all.
    Note that it's not a matter of trying different SARs to see which ones come out to 1024x576 or 768x576. We already know that (720x16/15=768, 720x64/45=1024). The issue is whether the 4:3 or 16:9 picture on a DVD is represented by the full 720x576 frame or a 704x576 subsection. If the latter, the full 720x576 frame represents an image wider than 4:3 or 16:9. There are conflicting opinions on this.
    I understand. So, the SAR is just an equation calculated with the videoīs
    height and width... and there can be only one correct? And must this be
    done with every type of video?

    Iīd like to set the correct SAR/DAR to not distort the picture, but I donīt
    know if you could use others for whatever reason, perhaps to display
    the video bigger or smaller, and if actually some people do this.

    What strikes me a bit is that the DAR of the PAL 16:9 clip is very wide,
    1024, compared to the PAL 4:3. But since VLC displays this same DAR
    with the MPEG-2 *.PS clips, Iīm happy. Perhaps itīs beacuse Iīm used
    to see the "720" figure and that makes me think that 1024 is too much
    of a "strech".

    Now a question arises... what about the black bars? Do they take space
    in the final encoding? If so, should I remove them in order to reduce the
    file size? Iīve seen itīs done with DVDs. If positive, should I crop the
    bars in Vegas, or later with Staxrip or MeGUI? And if I do it... does
    the SAR/DAR matter anymore with a cropped video?

    Cheers.
    Quote Quote  



Similar Threads

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