VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or Try ConvertXtoDVD and convert all your movies to DVD. Free trial ! :)
+ Reply to Thread
Results 1 to 7 of 7
Thread
  1. Member
    Join Date
    Jul 2016
    Location
    Italy
    Search PM
    Hello everybody,
    while messing around with a bad-quality video footage, I couldn't get rid of some strong block effect. Tried with Deblock_QED, but had no luck.

    Can anybody help me, please?
    Here's a sample - the block effect can be found after 5 seconds, in some other spots it's even a bit stronger. For me it would be nice to remove those artifacts.

    Thanks in advance.
    Image Attached Files
    Quote Quote  
  2. deblock_qed() usage for interlaced video:

    https://forum.videohelp.com/threads/361152-Correct-usage-of-Deblock_QED-for-Interlaced...ge#post2290489

    I put it in its own function, deblock_qed_i():

    Code:
    # Deblock_QED for interlaced video
    
    
    function deblock_qed_i ( clip clp, int "quant1", int "quant2", int "aOff1", int "bOff1", int "aOff2", int "bOff2", int "uv" )
    {
        quant1 = default( quant1, 24 ) # Strength of block edge deblocking
        quant2 = default( quant2, 26 ) # Strength of block internal deblocking
    
        aOff1 = default( aOff1, 1 ) # halfway "sensitivity" and halfway a strength modifier for borders
        aOff2 = default( aOff2, 1 ) # halfway "sensitivity" and halfway a strength modifier for block interiors
        bOff1 = default( bOff1, 2 ) # "sensitivity to detect blocking" for borders
        bOff2 = default( bOff2, 2 ) # "sensitivity to detect blocking" for block interiors
    
        uv    = default( uv, 3 )    # u=3 -> use proposed method for chroma deblocking
                                    # u=2 -> no chroma deblocking at all (fastest method)
                                    # u=1|-1 -> directly use chroma debl. from the normal|strong deblock()
    
        last=clp
        par=getparity()
        SeparateFields().PointResize(width,height)
        Deblock_QED(last, quant1, quant2, aOff1, aOff2, bOff1, bOff2, uv)
        AssumeFrameBased()
        SeparateFields()
        Merge(SelectEven(),SelectOdd())
        par ? AssumeTFF() : AssumeBFF()
        Weave() 
    }
    In your code use something like:

    Code:
    Mpeg2Source("Sample.d2v", CPU2="ooooxx", Info=3) 
    Deblock_QED_i(quant1=40, quant2=45)
    Your video has another big problem, torn fields:

    Image
    [Attachment 49515 - Click to enlarge]
    Last edited by jagabo; 4th Jul 2019 at 11:29.
    Quote Quote  
  3. Originally Posted by jagabo View Post
    Your video has another big problem, torn fields.
    Re-sizing interlace video without first deinterlacing?

    If so, he's got bigger problems to worry about.
    Quote Quote  
  4. Originally Posted by johnmeyer View Post
    Originally Posted by jagabo View Post
    Your video has another big problem, torn fields.
    Re-sizing interlace video without first deinterlacing?
    No, it only happens every sixth field. Probably a PAL-to-NTSC capture/conversion problem.
    Quote Quote  
  5. Member
    Join Date
    Jul 2016
    Location
    Italy
    Search PM
    Originally Posted by johnmeyer View Post
    Originally Posted by jagabo View Post
    Your video has another big problem, torn fields.
    Re-sizing interlace video without first deinterlacing?

    If so, he's got bigger problems to worry about.
    No, I didn't resize my source. The file I uploaded is the raw source as I received it. Thanks a lot jagabo for the tip, I played a little bit more with some parameters and the result is quite good. If anybody is able to suggest anything about the field issue, I would be very grateful.
    Quote Quote  
  6. Originally Posted by Marcoh_ View Post
    If anybody is able to suggest anything about the field issue, I would be very grateful.
    I don't see an obvious automated fix. You could always go through the video manually:

    Code:
    Mpeg2Source("Sample.d2v", CPU2="ooooxx", Info=3) 
    
    Deblock_QED_i(quant1=40, quant2=45)
    QTGMC(preset="fast")
    
    p1 = SelectEvery(6, 0,1,2,3,4).Trim(0,89)
    p2 = SelectEvery(6, 1,2,3,4,5).Trim(90,294)
    p3 = SelectEvery(6, 0,2,3,4,5).Trim(295,415)
    p4 = SelectEvery(6, 0,1,3,4,5).Trim(416,596)
    p5 = SelectEvery(6, 0,1,2,4,5).Trim(597,762)
    p6 = SelectEverY(6, 0,1,2,3,5).Trim(763,954
    
    p1 + p2 + p3 + p4 + p5 + p6
    Of course, it will take a long time to go through a full movie.
    Quote Quote  
  7. Here's a slightly simpler method:

    Code:
    Mpeg2Source("D:\Downloads\Sample.d2v", CPU2="xxxxxx", Info=3) 
    
    Deblock_QED_i(quant1=40, quant2=45)
    QTGMC(preset="fast")
    
    skip0 = SelectEvery(6,    1,2,3,4,5)
    skip1 = SelectEvery(6, 0,   2,3,4,5)
    skip2 = SelectEvery(6, 0,1,   3,4,5)
    skip3 = SelectEvery(6, 0,1,2,   4,5)
    skip4 = SelectEvery(6, 0,1,2,3,   5)
    skip5 = SelectEvery(6, 0,1,2,3,4   )
    
    skip0
    ReplaceFramesSimple(last, skip5, Mappings="[0 89]")
    ReplaceFramesSimple(last, skip1, Mappings="[295 415]")
    ReplaceFramesSimple(last, skip2, Mappings="[416 596]")
    ReplaceFramesSimple(last, skip3, Mappings="[597 762]")
    ReplaceFramesSimple(last, skip4, Mappings="[763 954]")
    ReplaceFramesSimple(last, skip5, Mappings="[954 1099]")
    That first builds the 6 possible skip-frame clips. Each will have some segments where the torn frames are removed. ReplaceFramesSimple(), included in the RemapFrames package, replaces frames in the first clip with frames taken from the second clip, as instructed by the mappings (see the docs). We use skip0 as the starting clip. Any segments where there are torn frames need to be replaced with a segment from one of the other drop-frame clips. For example, frames 295 to 415 contain torn frames in skip0 but are correct in skip2, hence the call to ReplaceFramesSimple(last, skip1, Mappings="[295 415]"). You still have to go through the video by hand looking for tears but this is easier than the way it was done in the earlier script.
    Quote Quote  



Similar Threads