VideoHelp Forum




+ Reply to Thread
Results 1 to 25 of 25
  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  
  16. sharc cat for kindness: seems that the script output is YV16.

    Can I get it YUY422 for direct encoding to ffmbc/ffmpeg/totalcode?
    Quote Quote  
  17. YV16 is YUV 4:2:2 planar. Your YV12 4:2:0 source is converted to YUV 4:2:2 planar in line 2 of the script of post#15.
    If you need it interleaved instead of planar you can replace the last line of the script by
    Code:
    return interlace.ConvertToYUY2(interlaced=true)
    This conversion is lossless.
    Last edited by Sharc; 20th Apr 2025 at 16:36.
    Quote Quote  
  18. sharc cat I ask this:

    due to the fact I can't use, at the moment, Rife

    Does exist an alternative to SmoothFPS2 that do sometimes artifacts?
    Quote Quote  
  19. Originally Posted by marcorocchini View Post
    sharc cat I ask this:

    due to the fact I can't use, at the moment, Rife

    Does exist an alternative to SmoothFPS2 that do sometimes artifacts?
    I don't understand your question, but RIFE is better than SmoothFPS2 and better than the other mvtools based interpolators I know (like framerateconverter) and better than what you produced with Resolve. "Better" means that it produces less annoying artefacts.
    You may google for other alternatives.
    Last edited by Sharc; 20th Apr 2025 at 16:59.
    Quote Quote  
  20. There are several motion compensated frame rate interpolators like FrameRateConverter(), InterFrame(), SVPflow(), etc.

    http://www.avisynth.nl/index.php/External_filters#Frame_Rate_Conversion

    Most variations use mvtools.
    Quote Quote  
  21. Please help the poor cat:

    Image
    [Attachment 86670 - Click to enlarge]


    I would like to "incapsulate" in 1 unique function the 3 lines:

    Code:
    santiag(2,2)
    fmask=masktools2_mt_edge().grayscale().blur(0.5)
    overlay(last, blur(1,0),mask=fmask,opacity=1.0,mode="blend")
    Do I need compile an .avsi file?

    Code:
    function SantiagComplex(clip c)
    
    {
    
    santiag(2,2)
    fmask=masktools2_mt_edge().grayscale().blur(0.5)
    overlay(last, blur(1,0),mask=fmask,opacity=1.0,mode="blend")
    
    }
    But seems it dont work
    Last edited by marcorocchini; 21st Apr 2025 at 11:02.
    Quote Quote  
  22. What's the purpose?

    Didn't test it much, so try below
    Code:
    function SantiagComplex(clip c,int radius,float decrisp)
    {
    santiag(c,radius,radius)
    mask=masktools2_mt_edge(c).grayscale().blur(0.5)
    overlay(c, blur(c,decrisp),mask=mask,opacity=1.0,mode="blend")
    }
    Call it in the script post#15 (line res=....) like
    Code:
    res=SantiagComplex(YV16,2,1.0)
    And eventually try:
    Code:
    LWLibavVideoSource("D:\Temp\marcorochini - the cat\Drone\25fpsDrone.mp4")
    
    z_ConvertFormat(pixel_type="YUV422P8", colorspace_op="709:auto:auto:limited=>709:same:same:limited")
    SmoothFPS2(last,50000,1000)
    SantiagComplex(last,2,1.0)
    
    assumeTFF().separatefields().selectevery(4,0,3).weave() #interlace
    ConvertToYUY2(interlaced=true)  #for 422 interleaved output
    
    prefetch(8)
    
    
    ########### FUNCTIONS #########################################################################################
    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)}
    
    function SantiagComplex(clip c,int radius,float decrisp)
    {
    santiag(c,radius,radius)
    mask=masktools2_mt_edge(c).grayscale().blur(0.5)
    return overlay(c, blur(c,decrisp),mask=mask,opacity=1.0,mode="blend")
    }
    ############################################################################################################
    Last edited by Sharc; 22nd Apr 2025 at 06:13.
    Quote Quote  
  23. ah wow seems works

    Code:
    SantiagComplex(YV16,2,1.0)
    but I wonder:

    the 1.0 is the value for blur argument?

    In this case, the equivalent of the original line

    Code:
    santiag(2,2)
    what should be using the new SantiagComplex function?
    Quote Quote  
  24. Originally Posted by marcorocchini View Post
    ... the 1.0 is the value for blur argument?
    Yes. This is the blur value for making the video look less sharp and less crispy but still keeping details - as you wanted in post#8. It has nothing to do with santiag.

    The script in post#22 does the same as the script in post#15. Only difference is the santiag parameters, and the "incapsulation" of santiag and the edge masked blurring in a new function which you named SantiagComplex() in post#21.
    I suggested santiag(3,3) in my earlier posts, you wanted santiag(2,2) in your non-working attempt in post#21. So I changed it to (2,2) in post#22.
    The function SantiagComplex(clip c,int radius,float decrisp) as defined at the end of the script in post#22, when called, invokes santiag(radius,radius) plus the edge masked blur(decrisp).
    So calling like SantiagComplex(v,2,1.0) means to process the video v with santiag(2,2) and with the edge masked blur(1.0)

    Just copy and paste the full script of post#15 or #22 and be done with it. They do the same, with the exception of the santiag parameters which I changed upon your request.

    (And once you have RIFE working revert to post#5 or #11).
    Last edited by Sharc; 22nd Apr 2025 at 16:30.
    Quote Quote  



Similar Threads

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