VideoHelp Forum
+ Reply to Thread
Results 1 to 28 of 28
Thread
  1. Hi cats

    sometimes I use the 25P or 50P from the dji drone and my project settings is 50i so many times I see flickering or jizzing details. Is there a way, an avisynth plugin or other methods, or better in ffmpeg to optimize the processing 25P to 50I so that image is clean from this issues?

    Or I need to set the dji camera in 30 or 50p?

    but if possible I would like to build a batch in ffmpeg so that is convert from the source alwais into 50i but removing the artifacts. Is there a particular filter in ffmpeg to do that?

    thanks
    Last edited by marcorocchini; 17th Jul 2022 at 15:55.
    Quote Quote  
  2. You didn't say how you are watching the 50i. On a CRT? Or passing through a deinterlacer?
    Quote Quote  
  3. Add a vertical blur so that you don't have sharp near horizontal edges. Blur(0.0, 0.5) or more. Also, 25p is always flickery with high contrast content with moderate motion. Motion blur helps a bit with that.
    Quote Quote  
  4. Member Skiller's Avatar
    Join Date
    Oct 2013
    Location
    Germany
    Search PM
    It's called Interline Twitter and (at low amounts) it is a normal artefact of interlaced video.


    As jagabo mentioned, a vertical blur or lowpass is needed. In fact, all properly created interlaced video has it applied!
    This is also why interlaced video has a maximum vertical resolution of about 0.7 times the lines count. If you create interlaced video with a vertical resolution approaching the lines count, it looks horrible, as you discovered.


    I have been using one of the following two lines for years for 576i output, or 576p that may be viewed through a 576i playback chain or mixed with 576i:

    Code:
    Blur(0, 0.7, false).Sharpen(0, 0.4, false) #normal
    
    Blur(0, 0.6, false).Sharpen(0, 0.4, false) #for less detailed sources
    The sharpen() may seem counterintuitive but like this it works more like a broadcast low-pass filter that "thickens" details rather than just a blur.



    Edit:
    Originally Posted by Luke M View Post
    You didn't say how you are watching the 50i. On a CRT? Or passing through a deinterlacer?
    Btw, this doesn't really matter here. Interline Twitter will show up for both deinterlacers as well as CRTs and look very similar. It's because there is too much vertical detail present only in one field and completely absent in the other (and vice versa). In such case it is impossible for basically all deinterlacers to determine whether this detail is motion or not. The safe thing for a deinterlacer to do is to consider it as motion, which results in excessive Interline Twitter.
    Last edited by Skiller; 19th Jul 2022 at 08:27.
    Quote Quote  
  5. I understand but for avisynth, does exist a more sofisticated tool than a simple blur? something that makes a more focused calculation, that acts only in the areas that most need anti twittering? Image
    [Attachment 65952 - Click to enlarge]
    Quote Quote  
  6. Use a mask of horizontal edges to limit the blurring to only sharp high contrast edges.
    Quote Quote  
  7. Originally Posted by s-mp View Post
    send sample
    in attachement, but at the moment I don't have the ND filter lenses
    Image Attached Files
    Quote Quote  
  8. Do you really have to encode in interlaced format
    Quote Quote  
  9. Code:
    FFVideoSource("C:\Users\Administrator\Desktop\concatHD.mov").SmoothFPS2(50000,1000).ConvertToYUY2(interlaced=false)
    B=Blur(0.1,0.5)
    Mask=ImageSource("v:\bluR4.jpg")
    Overlay(last,B,0,0,Mask)  
    vid=last
    aud=LWLibavAudioSource("C:\Users\Administrator\Desktop\Nuova cartella (6)\concatHD.mov")
    left=GetChannel(aud, 1)
    right=GetChannel(aud, 2)
    both=mergechannels(left, right)
    audiodub(vid, both)
    ConvertAudioTo16Bit()

    Image
    [Attachment 65997 - Click to enlarge]


    please jagabo if there is not another methods to reduce the fliackering when interlace, consider your old help of using the blur function over a mask. But I need to extend the whithe area of keying like the red circle, and if possible with a more "shading":

    Image
    [Attachment 65999 - Click to enlarge]


    please can you do a new .jpg image that match this request? thank you
    Image Attached Thumbnails Click image for larger version

Name:	bluR4.jpg
Views:	35
Size:	99.3 KB
ID:	65998  

    Quote Quote  
  10. Member Skiller's Avatar
    Join Date
    Oct 2013
    Location
    Germany
    Search PM
    Originally Posted by marcorocchini View Post
    please jagabo if there is not another methods to reduce the fliackering when interlace
    Like I said, to prevent this there shall be no details present in one field and absent in the other. So limiting the vertical bandwidth to make all details show up a bit in both fields is really the only way to archive that.

    I don't see how using a mask would be beneficial for this. Anything blurry enough not to cause the problem is barely made more blurry with the simple blur-sharpen combo I posted. You need to accept the limits of interlaced video or go progressive.
    Quote Quote  
  11. Something like this?

    Image
    [Attachment 66000 - Click to enlarge]


    And regarding you interlace twitter, your video is oversharp to start with. If you downscaled from 4K use a less sharp resize. Precise Bilinear in VirtualDub (BilinearResize in AviSynth) is the most natural.
    Last edited by jagabo; 23rd Jul 2022 at 22:11.
    Quote Quote  
  12. Originally Posted by Skiller View Post

    I don't see how using a mask would be beneficial for this. Anything blurry enough not to cause the problem is barely made more blurry with the simple blur-sharpen combo I posted. You need to accept the limits of interlaced video or go progressive.
    Image
    [Attachment 66035 - Click to enlarge]


    mmm

    the attempt is to convert from progressive to interlaced, obtaining a result that is not too wrong. I know that the conversion from progressive to interlaced is a pig but I find myself in a situation where I quickly have to do an interlaced delivery without thinking about it too long and I try to make a batch that helps in doing this without distorting the final result too much, if possible
    Quote Quote  
  13. Member Skiller's Avatar
    Join Date
    Oct 2013
    Location
    Germany
    Search PM
    Believe me when I say your expectations towards interlaced video are too high. I feel like I'm repeating myself. The solution is there.
    Quote Quote  
  14. Simple blur with mask of horizontal edges:

    Code:
    LWLibavVideoSource("25fps.MP4") 
    emask = mt_convolution(vertical="-1 2 -1").ColorYUV(off_y=-64).ColorYUV(gain_y=128).mt_expand(chroma="-128").Blur(1.4)
    Overlay(last, Blur(0.0, 0.7), mask=emask)
    Adjust the mask and amount of blur as desired.
    Last edited by jagabo; 24th Jul 2022 at 10:37.
    Quote Quote  
  15. Maybe resize the vertical resolution to 720p (while leaving the horizontal the same)?
    Quote Quote  
  16. Originally Posted by jagabo View Post
    Simple blur with mask of horizontal edges:

    Code:
    LWLibavVideoSource("25fps.MP4") 
    emask = mt_convolution(vertical="-1 2 -1").ColorYUV(off_y=-64).ColorYUV(gain_y=128).mt_expand(chroma="-128").Blur(1.4)
    Overlay(last, Blur(0.0, 0.7), mask=emask)
    Adjust the mask and amount of blur as desired.
    a little slow but it works well
    Quote Quote  
  17. Originally Posted by jagabo View Post
    Simple blur with mask of horizontal edges:

    Code:
    LWLibavVideoSource("25fps.MP4") 
    emask = mt_convolution(vertical="-1 2 -1").ColorYUV(off_y=-64).ColorYUV(gain_y=128).mt_expand(chroma="-128").Blur(1.4)
    Overlay(last, Blur(0.0, 0.7), mask=emask)
    Adjust the mask and amount of blur as desired.
    I did other tests, it really is the perfect goal but the encoding process becomes 6 fps (from 20) oh my ***
    Quote Quote  
  18. I didn't realize mt_convolution was so slow. Are you running a multithreaded version of AviSynth and a multicore CPU? If so, enable multithreading to speed it up. With 4 threads it will run over twice as fast.

    Or try using mt_edge instead of mt_convolution:

    Code:
    LWLibavVideoSource("25fps.MP4") 
    emask = mt_edge("-1 -1 -1    2 2 2    -1 -1 -1", thy1=20, thy2=20).mt_expand(chroma="-128").Blur(1.4)
    Overlay(last, Blur(0.0, 0.7), mask=emask)
    mt_edge with one thread is faster than mt_convolutions with four threads.

    mt_edge is pretty much all or nothing (per pixel):
    Image
    [Attachment 66043 - Click to enlarge]


    where mt_convolution is more nuanced with different degrees of transparency per pixel:
    Image
    [Attachment 66044 - Click to enlarge]
    Last edited by jagabo; 24th Jul 2022 at 23:31.
    Quote Quote  
  19. thanks jagabo I have do other proof

    avsInput.avs:

    Code:
    LSMASHVideoSource("c:\25fps.mp4")
    
    emask = mt_convolution(vertical="-1 2 -1").ColorYUV(off_y=-64).ColorYUV(gain_y=128).mt_expand(chroma="-128").Blur(1.4)
    Overlay(last, Blur(0.2, 0.7), mask=emask)
    
    SmoothFPS2(50000,1000).ConvertToYUY2(interlaced=false)
    
    assumeFPS(50)
    Prefetch(8)
    this works well and fast but I need to add the SmoothFPS2(50000,1000) because for my target, the output of avisynth have to be put for encoding in mxf 50i (mpeg2, 50 MBs) or mp4 420 interlaced (mbaff) like this:

    Code:
    ffmpeg64bit.exe -threads auto -y -i avsInput.avs -pix_fmt yuv420p  -vf interlace=lowpass=0:scan=tff   -c:v libx264 -profile:v main -level:v 4.2 -g 33 -bf 2 -crf 22 -flags +ildct+ilme -top 1 -an out.mp4
    I would have 2 question:

    to have an optical flow, does it exist a better alternative to SmoothFPS2(50000,1000)? it works almost well to correct the framerate 25-->50P but sometimes it create some artifacts. It is a subjective matter but using ConvertFPS(50000,1000) will create a slightly motion blur during image moovement.

    However assuming SmoothFPS2(50000,1000) and the 50P output of avisynth, is correct the use of
    Code:
    -vf interlace=lowpass=0:scan=tff
    for the ffmpeg encoding of a 50i output?
    Quote Quote  
  20. All the frame rate changers produce artifacts at times. Some of them allow you to fall back on blending when the motion estimation fails. A blend of two frames is less noticeable than gross deformations at normal playback speed. Some also have tunings for different types of material. Look at SVPFlow, FrameRateConverter, InterFrame, etc.

    That vf option (along with those encoding options) should give you correct interlaced output. Or you can do the interlacing in AviSynth:

    Code:
    # 50p source here
    AssumeTFF() # or BFF, whichever you need
    SeparateFields()
    SelectEvery(4,0,3)
    Weave()
    Quote Quote  
  21. If your drone can shoot 50p , why not use real 50p acquisition without interpolation artifacts? (instead of shooting 25p + optical flow resulting in interpolation artifacts and slower processing time)
    Quote Quote  
  22. Originally Posted by poisondeathray View Post
    If your drone can shoot 50p , why not use real 50p acquisition without interpolation artifacts? (instead of shooting 25p + optical flow resulting in interpolation artifacts and slower processing time)
    oh

    Image
    [Attachment 66126 - Click to enlarge]


    I'm a stoned cat. However yes, it's true: I don't know why I had in mind that at 50P there were similar problems but in fact if the target is 50i it would be the best solution to avoid the optical flow and related problems. But the question of flickering details remained, however using
    Code:
    emask = mt_convolution(vertical="-1 2 -1").ColorYUV(off_y=-64).ColorYUV(gain_y=128).mt_expand(chroma="-128").Blur(0.4)
    Overlay(last, Blur(0.3, 0.7), mask=emask)
    it is almost solved at the 100%
    Quote Quote  
  23. Code:
    emask = mt_convolution(vertical="-1 2 -1").ColorYUV(off_y=-64).ColorYUV(gain_y=128).mt_expand(chroma="-128").Blur(0.8)
    Overlay(last, Blur(0.5, 0.7), mask=emask)
    jagabo please: this have to be work only for progressive? or is suitable also for interlaced footage?
    Quote Quote  
  24. I don't think those artifacts can be solved without quality destruction. AviSynth takes information from neighboring frames but there will always be some kind of discordance between them due to the frames being taken at a different point in time. QTGMC bobbing could help. If it moves quicker, it's less noticeable to the eye and there's virtually no choppyness, unlike single-rate deinterlacing, plus QTGMC reconstructs the 50i at almost full resolution unless some kind of interpolation has to take place in an odd 1/50 frame. Your video shows some slow movement, I think it's pretty safe from any kind of interpolation. If you're keeping your video single-frame rate, I'd recommend using a motion-blur filter. Cheers
    Quote Quote  
  25. Originally Posted by marcorocchini View Post
    Code:
    emask = mt_convolution(vertical="-1 2 -1").ColorYUV(off_y=-64).ColorYUV(gain_y=128).mt_expand(chroma="-128").Blur(0.8)
    Overlay(last, Blur(0.5, 0.7), mask=emask)
    jagabo please: this have to be work only for progressive? or is suitable also for interlaced footage?
    You can't use that with interlaced video it will blur the two fields together resulting in ghosting. You need to deinteralace the video first, blur it, then reinterlace it.

    Code:
    QTGMC() # or some other double frame rate deinterlacer, Yadif(mode=1)?
    Blur(0.0, 0.5) # use whatever kind of blur you want here...
    SeparateFields()
    SelectEvery(4,0,3)
    Weave()
    Deinterlacing with SeparateFields() will be much faster but will give inferior results:

    Code:
    SeparateFields()
    Blur(0.0, 0.5) # use whatever kind of blur you want here...
    Weave()
    Quote Quote  
  26. Code:
    LoadPlugin("V:\masktools2.dll")
    
    LSMASHVideoSource("C:\Users\Administrator\Desktop\Nuova cartella (2)\DJI_0139.MP4")
    
    ConvertToYV12(interlaced=false)
    emask = mt_convolution(vertical="-1 2 -1").ColorYUV(off_y=-64).ColorYUV(gain_y=128).mt_expand(chroma="-128").Blur(0.8)
    Overlay(last, Blur(0.6, 0.7), mask=emask)
    ConvertToYUY2(interlaced=false)
    
    assumeFPS(50)
    
    Prefetch(8)
    Jagabo for kindness

    this working but I wonder: is there a way to avoid the ConvertToYV12?

    I need an output YUY2, alwais.

    Is there a way to improve quality in this case?
    Quote Quote  
  27. I don't remember what the output of LSMASH was for that video. YUY2? If so ConvertToYV16 should be lossless (just rearranges interleaved chroma to planar chroma) and will work with mt_convolution.
    Quote Quote  



Similar Threads

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