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
+ Reply to Thread
Results 1 to 28 of 28
-
Last edited by marcorocchini; 17th Jul 2022 at 15:55.
-
You didn't say how you are watching the 50i. On a CRT? Or passing through a deinterlacer?
-
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.
-
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
Edit:
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.
-
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?
[Attachment 65952 - Click to enlarge] -
Use a mask of horizontal edges to limit the blurring to only sharp high contrast edges.
-
-
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()
[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":
[Attachment 65999 - Click to enlarge]
please can you do a new .jpg image that match this request? thank you -
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. -
Something like this?
[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.
-
[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 -
Believe me when I say your expectations towards interlaced video are too high. I feel like I'm repeating myself. The solution is there.
-
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)
Last edited by jagabo; 24th Jul 2022 at 10:37.
-
Maybe resize the vertical resolution to 720p (while leaving the horizontal the same)?
-
-
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 is pretty much all or nothing (per pixel):
[Attachment 66043 - Click to enlarge]
where mt_convolution is more nuanced with different degrees of transparency per pixel:
[Attachment 66044 - Click to enlarge]Last edited by jagabo; 24th Jul 2022 at 23:31.
-
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)
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
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 ofCode:-vf interlace=lowpass=0:scan=tff
-
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()
-
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
[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)
-
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)
-
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
-
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()
Code:SeparateFields() Blur(0.0, 0.5) # use whatever kind of blur you want here... Weave()
-
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)
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? -
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.
Similar Threads
-
Removing details from video?
By JosephTocco in forum Newbie / General discussionsReplies: 10Last Post: 7th Dec 2021, 06:22 -
Trying to understand the details of a specific 3D File
By doctorm in forum Video ConversionReplies: 5Last Post: 3rd Jun 2020, 01:06 -
How to keep interlaced footage interlaced converting from AVI to MP4?
By kodec in forum Video ConversionReplies: 23Last Post: 1st Jul 2019, 09:36 -
Details lost while using madVR
By Ahmed Sadman in forum Software PlayingReplies: 4Last Post: 22nd Nov 2017, 22:44 -
Easiest free way to convert 25fps interlaced to 50fps de-interlaced?
By Gibson's Squares in forum MacReplies: 2Last Post: 25th Jul 2017, 08:06