VideoHelp Forum
+ Reply to Thread
Results 1 to 4 of 4
Thread
  1. Good morning friends,

    I don't know why the blue colors automatically change to purple after any filtering in avisynth.
    Notice in people's hair and skin that the reflected blue light changes color. Is there a script or some way to follow the original?
    Image Attached Thumbnails Click image for larger version

Name:	Screenshot_2.png
Views:	38
Size:	1.44 MB
ID:	82457  

    Quote Quote  
  2. Is it in the preview or just in the encoding? (might be vui signaling problem if it's really any filter and just after encoding)
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  3. You have a rec.601 vs rec.709 problem. Note the colorspace of the source. If you convert in AviSynth be sure to specify the corresponding matrix, for example:
    Code:
    ConvertToRGB(matrix="rec709")
    # RGB manipulations here
    ConvertToYV12(matrix="rec709")
    When you encode specify the matrix in the encoder. For example:
    Code:
    x264.exe --preset=slow --crf 18 --sar=1:1 --keyint 50 --colormatrix bt709 --output "output.mkv" "input.mkv"
    Make sure your player and editors follow the color flag. For example, VirtualDub assumes rec.601 by default. So it shows rec.709 video incorrectly.

    Note that standard definition video is usually rec.601, high definition video is usually rec.709. So if you're upscaling you want to convert rec.601 to rec.709: ColorMatrix("rec.601->rec.709").

    Code:
    ImageSource("Screenshot_2.png", start=0, end=23, fps=23.976) 
    AddBorders(0,0,1,2)
    ConvertToYV12(matrix="rec601")  # assume the left side is rec.601
    
    left = Crop(0,0,width/2,-0) # get the left half
    right = Crop(width/2,0,-0,-0) # get the right half
    right = right.ColorMatrix("rec.709->rec.601").ColorMatrix("rec.709->rec.601") # two rec.709 to rec.601 adjustments
    
    StackHorizontal(left, right) # stack the back together
    ConvertToRGB(matrix="rec601") # convert back to RGB
    Colors on the right half new match colors on the left.

    Image
    [Attachment 82461 - Click to enlarge]
    Last edited by jagabo; 25th Sep 2024 at 11:12.
    Quote Quote  
  4. Originally Posted by jagabo View Post
    You have a rec.601 vs rec.709 problem. Note the colorspace of the source. If you convert in AviSynth be sure to specify the corresponding matrix, for example:
    Code:
    ConvertToRGB(matrix="rec709")
    # RGB manipulations here
    ConvertToYV12(matrix="rec709")
    When you encode specify the matrix in the encoder. For example:
    Code:
    x264.exe --preset=slow --crf 18 --sar=1:1 --keyint 50 --colormatrix bt709 --output "output.mkv" "input.mkv"
    Make sure your player and editors follow the color flag. For example, VirtualDub assumes rec.601 by default. So it shows rec.709 video incorrectly.

    Note that standard definition video is usually rec.601, high definition video is usually rec.709. So if you're upscaling you want to convert rec.601 to rec.709: ColorMatrix("rec.601->rec.709").

    Code:
    ImageSource("Screenshot_2.png", start=0, end=23, fps=23.976) 
    AddBorders(0,0,1,2)
    ConvertToYV12(matrix="rec601")  # assume the left side is rec.601
    
    left = Crop(0,0,width/2,-0) # get the left half
    right = Crop(width/2,0,-0,-0) # get the right half
    right = right.ColorMatrix("rec.709->rec.601").ColorMatrix("rec.709->rec.601") # two rec.709 to rec.601 adjustments
    
    StackHorizontal(left, right) # stack the back together
    ConvertToRGB(matrix="rec601") # convert back to RGB
    Colors on the right half new match colors on the left.

    Image
    [Attachment 82461 - Click to enlarge]
    You solved my problem, friend.
    Thank you very much!
    Quote Quote  



Similar Threads

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