1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Transcoded results are brighter/darker

Discussion in 'Copy DVD to DVDR' started by jlz900, Dec 12, 2004.

  1. jlz900

    jlz900 Member

    Joined:
    Dec 9, 2004
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    11
    I've used DVDShrink 3.2 on many DVDs and Rebuilder/CCE 2.5 Basic for a few DVDs and I just now notice the brightness/color of the resulting compressed video is slightly different than the original. Rebuilder/CCE produces slightly darker with more natural looking color -- like using the "Levels adjustment" feature in Photoshop. DVDShrink produces sometimes slightly lighter and sometimes slightly darker results. I did this comparison by opening the VOB files in Media Player Classic and looking at them side by side. Has anyone noticed this difference and is there an explanation?
     
  2. jlz900

    jlz900 Member

    Joined:
    Dec 9, 2004
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    11
  3. pulsar

    pulsar Active member

    Joined:
    Dec 31, 2003
    Messages:
    2,081
    Likes Received:
    1
    Trophy Points:
    68
    I can only guess that different software could produce different results. The problem comes with how each deals with compression.
     
  4. jlz900

    jlz900 Member

    Joined:
    Dec 9, 2004
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    11
    Both programs compress well, but they seem to change the brightness in doing so. I understand how the compressed result would have artifacts and less detail, but not why it should be brighter or darker.
     
  5. pulsar

    pulsar Active member

    Joined:
    Dec 31, 2003
    Messages:
    2,081
    Likes Received:
    1
    Trophy Points:
    68
    I really do not know, I guess it is just one of those things. In burning nothing is definite!
     
  6. vurbal

    vurbal Administrator Staff Member

    Joined:
    Nov 30, 2002
    Messages:
    2,573
    Likes Received:
    1
    Trophy Points:
    66
    In DVD-RB's case I think it's an AviSynth issue. I haven't gotten a chance to do any backups since I learned about this, but apparently there's an issue with the color handling in the MPEG decoders for Avisynth that results in the difference you're seeing. You can solve it by using an Avisynth plugin called ColorMatrix which you can download from here:
    http://www.geocities.com/wilbertdijkhof/ColorMatrix_v15.zip

    The zip file will have a DLL in it that you need to extract into AviSynth's plugins directory (the default directory for this is C:\Program Files\Avisynth 2.5\plugins) and then you would have to open DVD-RB's filter editor and add this line:
    ColorMatrix()

    That should fix any color differences, but as I said I haven't tested this myself.
     
  7. jlz900

    jlz900 Member

    Joined:
    Dec 9, 2004
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    11
  8. vurbal

    vurbal Administrator Staff Member

    Joined:
    Nov 30, 2002
    Messages:
    2,573
    Likes Received:
    1
    Trophy Points:
    66
    It has to do with how color is stored for MPEG video. The color information is actually only on every other line (the color information on one line is actually a combination of the information for 2 lines) and ColorMatrix assumes that the lines that share color information are right next to each other. With interlaced video the lines aren't next to each other (each field has it's own information) so it won't work properly on interlaced video. Keep in mind that most sources aren't actually encoded interlaced since they come from film sources.

    Even if you do have interlaced video you don't necessarily have to deinterlace the final product. You can separate the fields (put all lines from field 1 together and all lines from field 2 together) before running the filter and then weave them together after the filter is run. There are many ways to do this, but this is the way I'd do it.

    1. Copy these lines into a text file:

    #Functions For Processing Interlaced Video
    #By stickboy (James D. Lin)#
    # SetParity
    function SetParity(clip c, bool parity)
    {
    return parity ? c.AssumeTFF() : c.AssumeBFF()
    }
    # UnfoldFieldsVertical
    function UnfoldFieldsVertical(clip c, bool "flip")
    {
    flip = default(flip, false)
    oldParity = c.GetParity()
    c = c.AssumeTFF().SeparateFields().AssumeFrameBased()
    top = c.SelectEven()
    bottom = c.SelectOdd()
    c = StackVertical(top, flip ? bottom.FlipVertical()
    \ : bottom)
    return c.SetParity(oldParity)
    }
    # FoldFieldsVertical
    function FoldFieldsVertical(clip c, bool "flip")
    {
    assert(c.Height() % 2 == 0, "FoldFieldsVertical: unexpected frame height")
    flip = default(flip, false)
    oldParity = c.GetParity()
    originalHeight = c.Height() / 2
    evens = c.Crop(0, 0, c.Width(), originalHeight)
    odds = c.Crop(0, originalHeight, c.Width(), originalHeight)
    odds = flip ? odds.FlipVertical() : odds
    c = Interleave(evens, odds).AssumeFieldBased().AssumeTFF().Weave()
    return c.SetParity(oldParity)
    }


    2. Save the text file (in the AviSynth plugins directory) as whatever.avsi Make sure you use the AVSI extension so it will be loaded automatically.

    3. Add this line before ColorMatrix():

    UnfoldFieldsVertical()

    4. Add this line after ColorMatrix():

    FoldFieldsVertical()

    These functions will separate and then weave the fields, allowing ColorMatrix to have progressive video to work on without destructively deinterlacing. Make sure you don't do this on progressive video or the colors won't be corrected properly.
     
    Last edited: Dec 22, 2004
  9. jlz900

    jlz900 Member

    Joined:
    Dec 9, 2004
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    11
    Thanks again. I think I'm all set up to create the highest quality DVD5s currently possible. The video it creates now is just a hair darker than the original which can be observed only if you study it very closely. Unfortunately, the ColorMatrix filter takes a very long time to do. There are alternate versions of ColorMatrix in that thread I linked which may be faster.

    Why do you suppose ColorMatrix isn't included in the DVD-RB guide? Do most users not have this issue or they do not notice the color difference?
     
  10. vurbal

    vurbal Administrator Staff Member

    Joined:
    Nov 30, 2002
    Messages:
    2,573
    Likes Received:
    1
    Trophy Points:
    66
    It's not included in the guide because it didn't exist (or I didn't know about it) when it was written. Updating my guides is on my (long) list of things to do. Likewise, I'm not sure if jdobbs has noticed it or else he would have probably added it as at least an option in the standard AVS filters for DVD-RB. I should probably ask about that. I'd also say that most users don't even notice.
     
  11. jlz900

    jlz900 Member

    Joined:
    Dec 9, 2004
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    11
    I got a brightness difference again between the compressed and original, but the problem seems to be the software I'm using. For example, if I preview with two windows of Media Player Classic next to each other, it shows that the compressed video is brighter than original. If I preview with two DVDShrink windows, it tells me the opposite. In PowerDVD they seem to be the same, but I cannot see them both side by side.

    I'd like to see them both side by side if possible. Is there some software that can do this and play them simultaneously?
     
    Last edited: Dec 26, 2004
  12. vurbal

    vurbal Administrator Staff Member

    Joined:
    Nov 30, 2002
    Messages:
    2,573
    Likes Received:
    1
    Trophy Points:
    66
    You could create an Avisynth script that would do it. Start by opening each of the discs in DGIndex (the version of DVD2AVI that comes with DGDecode) and create projects for them. Then make a text file (named whatever.avs) that has these lines:

    The AVS file will play in most media players (I prefer Media Player Classic) and it will show you the original on the left and the backup on the right. You could also use StackVertical(Original,Backup) instead of StackHorizontal(Original,Backup) to see the original on top of the backup instead of beside it.
     
    Last edited: Dec 27, 2004
  13. jlz900

    jlz900 Member

    Joined:
    Dec 9, 2004
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    11
    It works great, thanks very much. So the brightness is the same, and only in a few frames is a color difference barely noticeable. I can also now see the incredible job that CCE does.

    In 5 hours I produce a near-perfect replica (two passes, with ColorMatrix). It doesn't get much better than this.
     
    Last edited: Dec 27, 2004
  14. vurbal

    vurbal Administrator Staff Member

    Joined:
    Nov 30, 2002
    Messages:
    2,573
    Likes Received:
    1
    Trophy Points:
    66
    Good to hear.
     

Share This Page