Log in

View Full Version : drone from HD25P to HD25i with avisynth?


roccomarco
18th February 2026, 03:54
Hi

https://www.swisstransfer.com/d/c6360411-57de-4770-bbfd-80dafc477d93

this is my drone HD 25i. I need a proper transcoding with optical flow and antialiasing

I try


Import("v:\automazioneclip\avisynth\plugins\IResize.avsi")
Import("V:\automazioneclip\AviSynth\plugins\smoothFPS2.avsi")
Import("V:\automazioneclip\AviSynth\plugins\smoothFPS3.avsi")
Import("v:\automazioneclip\AviSynth\plugins\CropResizedic2017.avsi")
Import("V:\automazioneclip\AviSynth\FrameRateConverter2021\FrameRateConverter.avsi")
Import("V:\automazioneclip\AviSynth\LinearTransformation-3.0\LinearTransformation.avsi")
LoadPlugin("v:\automazioneclip\AviSynth\AVSCube\x64\vscube.dll")
LoadPlugin("v:\automazioneclip\AviSynth\FrameRateConverter2021\X64\FrameRateConverter.dll")
LoadPlugin("v:\automazioneclip\AviSynth\FFMS2_23_64bit\ffms2-2.23.1-msvc\x64\ffms2.dll")
Import("V:\automazioneclip\AviSynth\FFMS2_AVSI_2019\ffms2.avsi")
#LoadPlugin("v:\automazioneclip\AviSynth\LSMASH_AGO_2023\x64\LSMASHSource.dll")
LoadPlugin("V:\automazioneclip\AviSynth\LSMASH2024\LSMASHSource.dll")
LoadCPlugin("v:\automazioneclip\avisynth\plugins64\yadif.dll")
LoadPlugin("v:\automazioneclip\AviSynth\YADIFMOD2_2023\x64\yadifmod2.dll")
LoadPlugin("V:\automazioneclip\AviSynth\MaskTool2\X64\masktools2.dll")
LoadPlugin("V:\automazioneclip\AviSynth\Santiag\ResampleMT.dll")
LoadPlugin("V:\automazioneclip\AviSynth\Santiag\nnedi3.dll")
LoadPlugin("V:\automazioneclip\AviSynth\Santiag\aWarpsharpMT.dll")
LoadPlugin("V:\automazioneclip\AviSynth\Santiag\eedi3.dll")
LoadPlugin("V:\automazioneclip\AviSynth\Santiag\EEDI2.dll")
LoadPlugin("V:\automazioneclip\AviSynth\Santiag\GScript_26_64.dll")
LoadPlugin("V:\automazioneclip\AviSynth\Santiag\SangNom2.dll")
Import("V:\automazioneclip\AviSynth\Santiag\santiag.avsi")
Import("V:\automazioneclip\AviSynth\QTGMC2025\QTGMC.avsi")
Import("V:\automazioneclip\AviSynth\QTGMC2025\Zs_RF_Shared.avsi")
LoadPlugin("V:\automazioneclip\AviSynth\QTGMC2025\mvtools2.dll")
LoadPlugin("V:\automazioneclip\AviSynth\QTGMC2025\RgTools.dll")
LoadPlugin("v:\automazioneclip\AviSynth\BestSource\BestSource.dll")
LoadPlugin("V:\automazioneclip\AviSynth\RIFE\RIFE.dll")
LoadPlugin("V:\automazioneclip\AviSynth\RIFE\avsresize.dll")
LoadPlugin("V:\automazioneclip\AviSynth\RIFE\PlanarTools.dll")
LoadPlugin("V:\automazioneclip\AviSynth\HDRTools\x64\Release_W7_AVX2\HDRTools.dll")
LoadPlugin("V:\automazioneclip\AviSynth\temp\DGHDRtoSDR.dll")
LoadPlugin("V:\automazioneclip\AviSynth\temp\DGTonemap.dll")
LoadPlugin("v:\automazioneclip\AviSynth\AutoLevels\AutoLevels_x64.dll")
vid=LWLibAvVideoSource("C:\Users\Administrator\Desktop\Nuova cartella (11)\tempRecode.mkv").WriteFileStart("Framecount.txt", "Framecount()")
aud=LWLibavAudioSource("v:\automazioneclip\system\empty.wav",stream_index=0)
left=GetChannel(aud, 1)
right=GetChannel(aud, 2)
both=mergechannels(left, right)
audiodub(vid, both)
ConvertAudioTo16Bit()
#TurnRight()
#Turn180()
#TurnLeft()
converttoYV16(interlaced=false).FrameRateConverter(50000,1000, preset = "faster")
###eventualeInserimentoPlanar###
###eventualeInserimentoLinearTransformation###
converttoYV16(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)
###eventualeInserimentoPlanarPerYadifMod2###
ConvertToYUY2(interlaced=false)
assumeFPS(50)
###LastBeforePrefetch###
Prefetch(4)

Do you have a better idea? thanks

huhn
18th February 2026, 07:47
the file is 25p just as the title said but not your question.

the best way to turn this to 25i is to not do it the second best is adding a fake interlace flag to the encode and be done.

even with frame interpolation why would you need AA and most importantly interlacing at all?

FranceBB
15th March 2026, 18:34
the file is 25p just as the title said

Yep


the best way to turn this to 25i is to not do it the second best is adding a fake interlace flag to the encode and be done.


I *almost* agree.


even with frame interpolation why would you need AA


Well, from experience I can say that it's very easy to get aliasing with drones as they have lots of sharp edges that turn into aliasing when encoding as interlaced, so I totally get where Marco is coming from.

Let's start with the original footage at 25fps, if we go to frame 1160 and we do a simple crop to isolate the area


LWLibavVideoSource("25fps Drone DJI_.mp4")

Crop(1200, 0, -0, -500)


we can see some aliasing on the wires while the rest of the picture has sharp edges like on the leaves and on the tiles of the house on the roof but they're not aliased.

https://images2.imgbox.com/37/c0/JWTMQ9zx_o.png

So if we encode it as-is, namely 25p and simply flag it as interlaced, it will work, however the device at the other end will try to bob-deinterlace it and you're gonna get aliasing.

There are a few ways of simulating this:

A) Encoding as interlaced and then hitting the deinterlace on the player like MPV
B) Playing back the content via SDI to a proper broadcast reference monitor
C) Simply use Bob() within the frameserver

Option C is the easiest of course, so to simulate what a TV would do on the other side we can do:


LWLibavVideoSource("25fps Drone DJI_.mp4")

AssumeTFF()
Bob()

Crop(1200, 0, -0, -500)


In this case we're going to frame 2320 (i.e 1160 * 2) to see the corresponding result:

https://images2.imgbox.com/a1/cc/aluZTP7G_o.png

Of course this isn't acceptable as it would lead to severe aliasing all over the place, including the diagonal line of the house as well as the leaves and the wires etc.


To overcome this, what we need to do is blur vertically


LWLibavVideoSource("25fps Drone DJI_.mp4")

Blur(0, 1.58)


so now when we simulate the effect of a TV bob-deinterlacing it with


AssumeTFF()
Bob()


and we crop the relevant section of frame 2320


Crop(1200, 0, -0, -500)


we can see that the aliasing is gone:

https://images2.imgbox.com/07/63/8Fz0erKW_o.png

In other words, to encode in 25i TFF like if you need to re-encode to XDCAM-50 for instance, the final AVS Script would be:


#Indexing
video=LWLibavVideoSource("25fps Drone DJI_.mp4")
audio=BlankClip(length=1765, fps=25, audio_rate=48000, channels=8, sample_type="24bit")
AudioDub(video, audio)

#Blur vertically to remove aliasing
Blur(0, 1.58)

#Bring chroma to 422
Converttoyv16(matrix="Rec709", interlaced=false)

#Make sure we're in Limited TV Range
Limiter(min_luma=16, max_luma=235, min_chroma=16, max_chroma=240)

#Populating clip properties and frame properties
AssumeTFF()
propSet("_FieldBased", 2) #interlaced TFF



and then we can encode in MPEG-2 to produce the final 25i TFF XDCAM-50 (again, 25p flagged as interlaced but without aliasing when it's gonna be bobbed in this case as we blurred vertically)


ffmpeg.exe -hide_banner -i "25fps Drone DJI_.mp4.avs" -an -pix_fmt yuv422p -vcodec mpeg2video -s 1920:1080 -aspect 16:9 -vf setfield=tff -flags +ildct+ilme+cgop -b_strategy 0 -mpv_flags +strict_gop -sc_threshold 1000000000 -r 25 -b:v 50000k -minrate 50000k -maxrate 50000k -bufsize 36408333 -qmin 5 -qmax 28 -qsquish 99 -g 12 -bf 2 -profile:v 0 -level:v 2 -color_range 1 -color_primaries 1 -color_trc 1 -colorspace 1 -y "raw_video.m2v"

ffmpeg.exe -hide_banner -i "25fps Drone DJI_.mp4.avs" -c:a pcm_s24le -ar 48000 -rf64 always -f wav -y "audio.wav"

ffmpeg.exe -hide_banner -i "raw_video.m2v" -i "audio.wav" -c:v copy -c:a copy -f mxf -y "pre-final_output.mxf"

bmxtranswrap.exe -p -y 10:00:00:00 -t op1a -o "final_output.mxf" "pre-final_output.mxf"

pause



Here's the encoded version: https://we.tl/t-2nTWOguug9
(link valid for 3 days)

SeeMoreDigital
16th March 2026, 12:26
@roccomarco

Why do you want to convert a perfectly good H264/AVC 1920x1080 25fps progressive source to interlaced?

Sharc
17th March 2026, 21:11
@roccomarco

Why do you want to convert a perfectly good H264/AVC 1920x1080 25fps progressive source to interlaced?
Because he is a cat!
https://forum.videohelp.com/threads/417843-Santiag-for-progressive-to-interlaced
https://forum.videohelp.com/threads/393748-avisynth-50p-to-50i-how-to-avoid-the-flickering-artifacts
https://forum.videohelp.com/threads/406409-flickering-details-when-interlaced
.. and many more.
Many times was explained to the cat the need for vertical blurring / vertical lowpass filtering when converting sharp progressive footage to interlaced :D :D :D

wonkey_monkey
17th March 2026, 23:29
@roccomarco

Why do you want to convert a perfectly good H264/AVC 1920x1080 25fps progressive source to interlaced?

Only two possibilities I can see (after accepting that 50fps is the target): it's intended to be burned to Blu-ray, or the user's TV can't do 1080p50 (like my old one couldn't).

Neither seems very likely though...

_Al_
3rd April 2026, 00:22
I'd say, most likely, local broadcast station would accept only 25i.