VideoHelp Forum




+ Reply to Thread
Results 1 to 12 of 12
  1. Member
    Join Date
    May 2011
    Location
    Sweden
    Search PM
    Using QTGMC generates an annoying flicker on a static logo (at "10 Edicao") which already looks ok even in interlaced form. Is there any way to "tell" QTGMC to ignore a certain x1, y1, x2, y2 area with the logo? How to make that top right logo stay static?
    Image Attached Files
    Quote Quote  
  2. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Make a mask of the logo then use it to overlay the logo back from the original video.
    Quote Quote  
  3. There is no 'ignore region' option for QTGMC.
    What should a deinterlacer do with the separate fields when it should ignore a region?
    You could try BWDIF instead of or in combination with QTGMC. (or some field matcher, in case the source isn't interlaced to start with)
    Got a sample of the source? (the provided clip seems progressive)
    What does your script look like?
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  4. Originally Posted by Selur View Post
    ... (the provided clip seems progressive) ...
    It is true interlaced 29.97i, 59.94 fields per second, TFF
    Quote Quote  
  5. Strange, must be due to some scaling on my laptop.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  6. Ah, the progressive logo was added on the fields. BWDIF or TDeint are better than QTGMC for such sources.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  7. Yes, try something like this:
    Code:
    assumeTFF()
    TDeint(mode=1,tryweave=true)
    QTGMC(inputType=1)
    Image Attached Files
    Last edited by Sharc; 21st Apr 2025 at 05:36. Reason: Clip added
    Quote Quote  
  8. Member
    Join Date
    May 2011
    Location
    Sweden
    Search PM
    Originally Posted by Sharc View Post
    Yes, try something like this:
    Code:
    assumeTFF()
    TDeint(mode=1,tryweave=true)
    QTGMC(inputType=1)
    Thanks. But I don't care about the logo itself (just the flicker to be gone), the priority is the main image to look as good as possible. Perhaps those tiny horizontal lines from the logo's yellow ribbon trick QTGMC to treat them as combing artifacts. I'll use logo masking suggested by VoodooFX.

    Anyway, good to know. I added that code to my Avisynth templates (I keep a collection of useful snippets for various scenarios).

    Edit: I finally managed to get good results with logo masking. That's the script I used:

    Code:
    SetFilterMTMode("QTGMC", 2)
    LWLibavVideoSource("sample.mkv")
    AssumeTFF()
    AssumeFPS(29.970)
    QTGMC(Preset="Slow", FPSDivisor=1, MatchPreset="Slow", Sharpness=0.5, TR2=3)
    maskclip = ColorKeyMask(FFmpegSource2("logomask.png"), $ff0000, 60)
    Overlay(FFmpegSource2("logo.png"), mask=maskclip.ShowAlpha, mode="blend", opacity=1, x=1554, y=116, output="YV12")
    Prefetch(4)
    I managed to find the logo in good quality and for the mask I painted red the areas where I wanted transparency.
    Image Attached Files
    Last edited by elektro; 21st Apr 2025 at 09:08.
    Quote Quote  
  9. Something like this:
    Code:
    clip_base=ffms2("sample.mkv")  #your video
    clip_base=clip_base.AssumeTFF().QTGMC() #deinterlace
    clip_overlay=ImageSource("logo.png")  #your logo snippet
    overlay(clip_base,clip_overlay,x=1739,y=114)  #adjust x and y to fit the position exactly
    You could use a graphic tool ("magic wand") to cut a more precise part out of the logo for the overlay.
    Or you could try with Avisynth's masktools.
    Last edited by Sharc; 21st Apr 2025 at 09:05.
    Quote Quote  
  10. Member
    Join Date
    May 2011
    Location
    Sweden
    Search PM
    Originally Posted by Sharc View Post
    Something like this:
    Code:
    clip_base=ffms2("sample.mkv")  #your video
    clip_base=clip_base.AssumeTFF().QTGMC() #deinterlace
    clip_overlay=ImageSource("logo.png")  #your logo snippet
    overlay(clip_base,clip_overlay,x=1739,y=114)  #adjust x and y to fit the position exactly
    You could use a graphic tool ("magic wand") to cut a more precise part out of the logo for the overlay.
    Or you could try with Avisynth's masktools.
    Thanks. After some trial and error I managed to find a solution (see the previous post). In your code snippet, is it not required to paint the areas for transparency and use the existing transparency channel from PNG?
    Quote Quote  
  11. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by elektro View Post
    I read about the Overlay function but it's confusing
    Use it like that:
    Code:
    original_video = LWLibAvVideoSource("D:\sample.mkv")
    processed_video = original_video # pseudo code, insert your own, like QTGMC 
    
    mask=ImageSource("D:\xxx.bmp").ConvertToY8.Trim(0,-1)
    
    Overlay(processed_video, original_video, mask=mask)
    Originally Posted by elektro View Post
    How to make a logo mask out of this logo fragment?
    Use Photoshop or similar.

    You can use InpaintDelogo to get a mask, for example:
    Code:
    InpaintDelogo(Loc="1540,100,-70,-876", mask="d:\xxx.bmp", Automask=1, Analyze=3)
    It should be used on your full video, after deinterlace. Here what I got from your sample (no idea if it's good):
    Image Attached Thumbnails Click image for larger version

Name:	xxx.png
Views:	5
Size:	6.7 KB
ID:	86667  

    Quote Quote  
  12. In your code snippet, is it not required to paint the areas for transparency and use the existing transparency channel from PNG?
    It was a simple 'overlay' example only for demo. Glad you found your way.
    Quote Quote  



Similar Threads

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