VideoHelp Forum




+ Reply to Thread
Results 1 to 15 of 15
  1. Hi

    please be patient:
    # <--here a poor cat ###

    So my target is transcode properly my horrible drone that is a 25fps, output format: MXF xdcamhd422 profile, 50i interlaced

    whit a filter to avoid aliasing ad artifacts due to conversion.

    Please download the horrible:

    https://www.swisstransfer.com/d/45e6c1bf-f64c-4af1-a73b-c96718efe466

    My empirically script (drone7.avs):

    Code:
    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")
    LoadPlugin("v:\automazioneclip\AviSynth\FrameRateConverter2021\X64\FrameRateConverter.dll")
    LoadPlugin("v:\automazioneclip\AviSynth\colormatrix26\X64\ColorMatrix64.dll")
    Import("V:\automazioneclip\AviSynth\FFMS2_AVSI_2019\ffms2.avsi")
    LoadPlugin("v:\automazioneclip\AviSynth\LSMASH_AGO_2023\x64\LSMASHSource.dll")
    LoadPlugin("V:\automazioneclip\AviSynth\FFMS2_R1363_AGO2023\X64\ffms2.dll")
    LoadCPlugin("v:\automazioneclip\avisynth\plugins64\yadif.dll")
    LoadPlugin("V:\automazioneclip\AviSynth\MaskTool2\X64\masktools2.dll")
    LoadPlugin("V:\automazioneclip\AviSynth\RIFE\avsresize.dll")
    LoadPlugin("v:\automazioneclip\AviSynth\BestSource\BestSource.dll")
    LoadPlugin("v:\ResampleMT.dll")
    LoadPlugin("v:\nnedi3.dll")
    LoadPlugin("v:\aWarpsharpMT.dll")
    #LoadPlugin("v:\nnedi2.dll")
    LoadPlugin("v:\eedi3.dll")
    LoadPlugin("v:\EEDI2.dll")
    LoadPlugin("v:\GScript_26_64.dll")
    LoadPlugin("v:\SangNom2.dll")
    
    Import("c:\santiag.avsi")
    
    BSVideoSource("v:\25fpsDrone.mp4")
    #ConvertToYV24()
    FrameRateConverter(50000,1000, preset = "faster")
    
    santiag(strh=2, strv=1, type="nnedi3", nns=0, threads=0, nsize=6, halfres=false, scaler_post="Spline36Resize")
    
    ConvertToYUY2(interlaced=false)
    
    assumetff().separatefields().SelectEvery(4, 0, 3).weave() #interlace
    
    Prefetch(8)
    and then the transcoding process is:

    ffmpeg2025.exe -v quiet -stats -y -i v:\drone7.avs -an -pix_fmt yuv422p -f rawvideo - | v:\ffmbcX642017.exe -threads 12 -s 1920x1080 -r 25 -y -f rawvideo -pix_fmt yuv422p -i - -i "v:\10 - Traccia 10_HDavs.wav" -tff -target xdcamhd422 -an -ac 4 v:\drone5.mxf -newaudio -acodec pcm_s24le -ar 48000

    processing is slow 7 fps

    this my results:
    https://www.swisstransfer.com/d/c69054c8-c470-48c5-9d9e-5d8823c6fcbc

    I try to replace emask with santiag to see if I can see better results, or I'm wrong? in any case can the script be better corrected?
    let me know your opinion cat

    thanks thanks
    Image Attached Files
    Last edited by marcorocchini; 16th Apr 2025 at 15:10.
    Quote Quote  
  2. Use RIFE
    Code:
    LWLibavVideoSource("25fpsDrone.mp4") #your progressive 25fps source
    
    RGB=z_ConvertFormat(pixel_type="RGBPS", colorspace_op="709:auto:auto:limited=>rgb:same:same:full") # convert to RGB floats
    RIFE=RGB.RIFE(gpu_thread=1, model=11, fps_num=50000, fps_den=1000, sc=true, sc_threshold=0.3) # motion interpolation using model 11
    YV12=RIFE.z_ConvertFormat(pixel_type="YUV420P8", colorspace_op="rgb:auto:auto:full=>709:same:same:limited") # convert back to YV12
    
    interlace=YV12.separatefields().selectevery(4,0,3).weave() #interlace
    
    prefetch(8)
    return interlace
    Image Attached Files
    Last edited by Sharc; 17th Mar 2025 at 03:40.
    Quote Quote  
  3. ^^^^
    Improvement: Select model=12 in the script above. It seems to produce less annoying interpolation artefacts, but is slower. You can experiment yourself to find the "best" model ....

    Code:
    LWLibavVideoSource("25fpsDrone.mp4")  #your 25p source
    
    RGB=z_ConvertFormat(pixel_type="RGBPS", colorspace_op="709:auto:auto:limited=>rgb:same:same:full") # convert to RGB floats
    RIFE=RGB.RIFE(gpu_thread=1, model=12, fps_num=50000, fps_den=1000, sc=true, sc_threshold=0.3) # motion interpolation using model 12
    YV12=RIFE.z_ConvertFormat(pixel_type="YUV420P8", colorspace_op="rgb:auto:auto:full=>709:same:same:limited") # convert back to YV12
    
    interlace=YV12.assumeTFF().separatefields().selectevery(4,0,3).weave() #interlace
    
    prefetch(8)
    return interlace
    Image Attached Files
    Last edited by Sharc; 17th Mar 2025 at 04:27.
    Quote Quote  
  4. Sharc cat for kindness:

    my target is encode to 422 (xdcamhd422) so I try this:

    Code:
    BSVideoSource("v:\25fpsDrone.mp4")  #your 25p source
    
    RGB=z_ConvertFormat(pixel_type="RGBPS", colorspace_op="709:auto:auto:limited=>rgb:same:same:full") # convert to RGB floats
    RIFE=RGB.RIFE(gpu_thread=1, model=12, fps_num=50000, fps_den=1000, sc=true, sc_threshold=0.3) # motion interpolation using model 12
    YV12=RIFE.z_ConvertFormat(pixel_type="YUV420P8", colorspace_op="rgb:auto:auto:full=>709:same:same:limited").convertToYUY2(interlaced=false) # convert back to YV12
    
    
    interlace=YV12.assumeTFF().separatefields().selectevery(4,0,3).weave() #interlace
    
    
    return interlace
    prefetch(8)
    need I to change the YUV420P8 parameter?

    and is there a more speed model?
    Quote Quote  
  5. For YUV422 output:
    Code:
    LWLibavVideoSource("Drone\25fpsDrone.mp4")
    
    RGB=z_ConvertFormat(pixel_type="RGBPS", colorspace_op="709:auto:auto:limited=>rgb:same:same:full") 
    RIFE=RGB.RIFE(gpu_thread=1, model=12, fps_num=50000, fps_den=1000, sc=true, sc_threshold=0.3) 
    YV16=RIFE.z_ConvertFormat(pixel_type="YUV422P8", colorspace_op="rgb:auto:auto:full=>709:same:same:limited")
    interlace=YV16.assumeTFF().separatefields().selectevery(4,0,3).weave()
    
    prefetch(8)
    return interlace
    ...and is there a more speed model?
    Try all models, one by one, and tell us your findings.
    Last edited by Sharc; 14th Apr 2025 at 18:28.
    Quote Quote  
  6. model 12 seems good, but maybe, I need to apply a little, advanced, antialiasing line.

    However:

    let explain the cat

    This is my source:

    https://www.swisstransfer.com/d/5eaa2e33-8ac3-4f34-aea4-f14062ca14f1

    it's my low quality drone video wow, 25P

    My target is get an interlaced version of it, 50i, transcoded ok, minimizing artifacts.

    I tryied with Da*****R*****ve: import a 50i in timeline-->import the horrible drone 25P file--> set the use of Optical Flow --> set the SuperScale 4X processing. From this I get this output:

    https://www.swisstransfer.com/d/f845b80a-3039-469a-beb5-2093d517f8c3

    that seems not bad but there are some little artifacts in certain point.

    However I don't like a lot to use Da*****R*****ve, if possible, and I try to transcode with an avisynth script.

    So what is the correct way to optimize this process?
    Quote Quote  
  7. I am not aware of any interpolator which does NOT produce any artifacts.
    RIFE is sharper, preserves much more details and has much less interpolation artifacts (see for example the TV antenna on the roof) than your Resolve version.
    Watch the separated fields of the 2 variants interleaved and you will easily see the differences.
    Last edited by Sharc; 16th Apr 2025 at 17:47.
    Quote Quote  
  8. I cat understand

    but the result of the only rife seems a little too sharp for me, is there perhaps some rife models that integrates something like greater antialiasing?

    The preservation of details, however important, risks becoming excessive if this implies a little too much "noise" on images that have a low quality origin like my drone, or images coming from low level cameras whose electronic signal processing is not at low intermodulation, in this case, at this point, it seems more correct to "hide" details during transcoding even if overall the image is slightly softer, rather than maintaining high details but at the same time high crudeness and crispening
    Quote Quote  
  9. You can always soften or blur or otherwise tweak your video (e.g. just before re-interlacing the RIFE interpolation) using usual Avisynth filters for example. Or you can apply filters to your original progressive source. Try what suits you best.
    Quote Quote  
  10. ok cat but there are a recent antialiasing plugin for avisynth? or something that apply a little noise reduction?

    What can it be the final script for my horrible drone source?
    Quote Quote  
  11. Originally Posted by marcorocchini View Post
    What can it be the final script for my horrible drone source?
    The one which pleases your eyes most.

    If you want to reduce "crispiness" and aliasing you can try on progressive video something like

    Code:
    LWLibavVideoSource("25fpsDrone.mp4")
    
    RGB=z_ConvertFormat(pixel_type="RGBPS", colorspace_op="709:auto:auto:limited=>rgb:same:same:full")
    RIFE=RGB.RIFE(gpu_thread=1, model=12, fps_num=50000, fps_den=1000, sc=true, sc_threshold=0.3)
    YV12=RIFE.z_ConvertFormat(pixel_type="YUV420P8", colorspace_op="rgb:auto:auto:full=>709:same:same:limited") # convert back to YV12
    
    mask=masktools2_mt_edge(YV12).grayscale()
    blur=YV12.blur(1.0)
    res=overlay(YV12, blur,mask=mask,opacity=1.0,mode="blend")
    
    interlace=res.assumeTFF().separatefields().selectevery(4,0,3).weave() #interlace
    
    prefetch(8)
    
    return interlace
    Last edited by Sharc; 17th Apr 2025 at 09:45. Reason: typo
    Quote Quote  
  12. sharc cat please I need that: the script should present an output YUV422

    Need I to add at the end of the script the converttoYUY2(interlaced=false) ?
    Quote Quote  
  13. Originally Posted by marcorocchini View Post
    sharc cat please I need that: the script should present an output YUV422

    Need I to add at the end of the script the converttoYUY2(interlaced=false) ?
    No.
    I already told you in post#5 how to do it. So here again:

    Code:
    LWLibavVideoSource("25fpsDrone.mp4")
    
    RGB=z_ConvertFormat(pixel_type="RGBPS", colorspace_op="709:auto:auto:limited=>rgb:same:same:full")
    RIFE=RGB.RIFE(gpu_thread=1, model=12, fps_num=50000, fps_den=1000, sc=true, sc_threshold=0.3)
    YV16=RIFE.z_ConvertFormat(pixel_type="YUV422P8", colorspace_op="rgb:auto:auto:full=>709:same:same:limited")
    
    YV16=YV16.santiag(3,3)
    mask=masktools2_mt_edge(YV16).grayscale().blur(0.5)
    blur=YV16.blur(1.0)
    res=overlay(YV16, blur,mask=mask,opacity=1.0,mode="blend")
    
    interlace=res.assumeTFF().separatefields().selectevery(4,0,3).weave()
    
    prefetch(8)
    return interlace
    Image Attached Files
    Last edited by Sharc; 18th Apr 2025 at 04:00. Reason: File attached
    Quote Quote  
  14. Sharc I think to have a problem with all version of Avisynth greater than R3661: I use Mainconcept Totalcode to encode the .avs but the versions that support RIFE wont load the audio part of the .avs

    I don't know the reason but I force to use, at leat for the moment, Avisynth R3661 and RIFE is not working.

    So I try to replace RIFE with the smoothFPS2.avsi:

    function SmoothFPS2(clip source, int num, int den) {
    super = MSuper(source, pel=2, hpad=0, vpad=0, rfilter=4)
    backward_1 = MAnalyse(super, chroma=false, isb=true, blksize=32, searchparam=3, plevel=0, search=3, badrange=(-24))
    forward_1 = MAnalyse(super, chroma=false, isb=false, blksize=32, searchparam=3, plevel=0, search=3, badrange=(-24))
    backward_2 = MRecalculate(super, chroma=false, backward_1, blksize=8, searchparam=1, search=3)
    forward_2 = MRecalculate(super, chroma=false, forward_1, blksize=8, searchparam=1, search=3)
    backward_3 = MRecalculate(super, chroma=false, backward_2, blksize=4, searchparam=0, search=3)
    forward_3 = MRecalculate(super, chroma=false, forward_2, blksize=4, searchparam=0, search=3)
    MBlockFps(source, super, backward_3, forward_3, num, den, mode=0)}

    that seems work not very bad.

    but I'm not able to modify the script to use it instead of Rife, what can I do?
    Quote Quote  
  15. Your posted source file '25fpsDrone.mp4' has no audio track, btw.

    But anyway, here the RIFE replacement as you wish:

    Code:
    LWLibavVideoSource("25fpsDrone.mp4")
    
    YV16=z_ConvertFormat(pixel_type="YUV422P8", colorspace_op="709:auto:auto:limited=>709:same:same:limited")
    YV16=SmoothFPS2(YV16,50000,1000)
    
    YV16=YV16.santiag(3,3)
    mask=masktools2_mt_edge(YV16).grayscale().blur(0.5)
    blur=YV16.blur(1.0)
    res=overlay(YV16, blur,mask=mask,opacity=1.0,mode="blend")
    interlace=res.assumeTFF().separatefields().selectevery(4,0,3).weave() #interlace
    
    prefetch(8)
    return interlace
    
    ################# FUNCTION ####################################################
    function SmoothFPS2(clip source, int num, int den) {
    super = MSuper(source, pel=2, hpad=0, vpad=0, rfilter=4)
    backward_1 = MAnalyse(super, chroma=false, isb=true, blksize=32, searchparam=3, plevel=0, search=3, badrange=(-24))
    forward_1 = MAnalyse(super, chroma=false, isb=false, blksize=32, searchparam=3, plevel=0, search=3, badrange=(-24))
    backward_2 = MRecalculate(super, chroma=false, backward_1, blksize=8, searchparam=1, search=3)
    forward_2 = MRecalculate(super, chroma=false, forward_1, blksize=8, searchparam=1, search=3)
    backward_3 = MRecalculate(super, chroma=false, backward_2, blksize=4, searchparam=0, search=3)
    forward_3 = MRecalculate(super, chroma=false, forward_2, blksize=4, searchparam=0, search=3)
    MBlockFps(source, super, backward_3, forward_3, num, den, mode=0)}
    ###############################################################################
    Quote Quote  



Similar Threads

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