VideoHelp Forum




+ Reply to Thread
Results 1 to 5 of 5
  1. Any script-guru on Avisynth knows what's wrong with this (part of a) script:

    ConditionalSelect(film,"
    V0 = VPlaneMax(film)
    V1 = VPlaneMax(film1)
    V0 <= V1 ? 0 : 1",film, film1)

    It should pick frame(s) from "film" if it's VplaneMax-value is smaller than "film1" else it should take "film1".
    It kind of works but .... not always
    Sometimes it takes the higher value clip.

    Any idea's? Something wrong with the "0 : 1" ?
    Quote Quote  
  2. Could you upload a very short clip (and corresponding script) which shows your problem?
    Quote Quote  
  3. Do you realize that VPlaneMax() is the max of the chroma V plane, not the intensity (Y plane)?
    Quote Quote  
  4. I took a random YV12 video file and applied this script:

    Code:
    film = Trim(1000,2000).Subtitle("film", text_color=$ffffff)
    film1 = Trim(3000, 4000).Subtitle("film1", text_color=$ffffff)
    
    ConditionalSelect(film,"
    V0 = VPlaneMax(film)
    V1 = VPlaneMax(film1)
    V0 <= V1 ? 0 : 1",film, film1)
    
    StackHorizontal(film.ColorYUV(Analyze=true), film1.ColorYUV(Analyze=true), last)
    The function did exactly what was expected. The output of ConditionalSelect() was the video with the lower peak V value.
    Quote Quote  
  5. Thanks for responding! What I want to do is some whitebalancing/colorcorrection. I have some super8 scans but sometimes parts of it have a redish hue. Not one of the known filters (coloryuv, autobalance) is perfect however so I combined them both + the original so the result will be the frames with the lowest V-value.
    This gives rather nice results:

    Code:
    ConditionalSelect(film,"
    V0 = VPlaneMax(film)
    V1 = VPlaneMax(film1)
    V2 = VPlaneMax(film2)
    V0 <= V1 && V0 <= V2 ? 0 : (V1 <= V2 ? 1 : 2)", film, film1, film2)
    The problem I had is sort of solved and appears to be the "Reopen Video file"-option in VirtualDub. I noticed this often. Apperantly, after changing a script, it's best NOT to "reopen" the file but fresh restart VD with the changed script.

    Thanks!
    Quote Quote  



Similar Threads

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