VideoHelp Forum




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

    I'm a cat. Please patient. thanks

    https://www.swisstransfer.com/d/9e317838-d99b-48cd-b858-263125d3e9c9

    download my mxf 50p 3840x2160

    my target is an high quality - efficient encoding 8bit, double pass, scaled to HD resolution target mp4 file:


    I'm try

    Code:
    ffmpeg.exe -v quiet -stats -threads auto -vf scale=interl=1 -vf zscale=1920:1080 -sws_flags lanczos+accurate_rnd -pix_fmt yuv422p -c:v libx264 -b:v 5100k -minrate 5600k -maxrate 13000k -bufsize 14000k -x264-params 8x8dct=1 -g 12 -bf 1 -rc vbr_2pass -rc-lookahead 32 -crf 22 -c:a aac -b:a 750k -ar 48000 -aspect 16:9 OUT.MP4
    with bitrage average 12/15Mb/s

    can you correct my commandline? if possible avoiding the -b:v 5100k -minrate 5600k -maxrate 13000k
    Last edited by marcorocchini; 15th Feb 2026 at 15:18.
    Quote Quote  
  2. https://trac.ffmpeg.org/wiki/Encode/H.264

    btw dual pass / multipass is useful when your goal is particular SIZE of encoded file (for example your goal is to fit your source in strictly limited space such as CD/DVD disc etc).
    For quality encoding you should focus on CRF with eventual details about decoder aspects (such as maximum bitrate allowed by your decoder) also bitrate size should correspond to your REAL target capabilities.
    Quote Quote  
  3. Code:
    ffmpeg.exe -v quiet -stats -threads auto -y -i temp.mkv -pix_fmt yuv422p -profile:v high422 -level:v 4.2 -filter_complex "[0:1] [0:2] amerge" -vf scale=interl=1 -vf zscale=1920:1080,interlace -sws_flags lanczos+accurate_rnd -c:v libx264 -b:v 13000k -minrate 1000k -maxrate 19000k -bufsize 48000k -x264-params 8x8dct=1 -g 12 -bf 1 -preset slow -rc vbr_2pass -rc-lookahead 32 -crf 22 -flags +ilme+ildct -top 1 -c:a aac -b:a 750k -ar 48000 -aspect 16:9 -r 25 -fflags +genpts -bsf:v h264_mp4toannexb -pass 1 -f null NUL && ffmpeg.exe -v quiet -stats -threads auto -y -i temp.mkv -pix_fmt yuv422p -profile:v high422 -level:v 4.2 -filter_complex "[0:1] [0:2] amerge" -vf scale=interl=1 -vf zscale=1920:1080,interlace -sws_flags lanczos+accurate_rnd -c:v libx264 -b:v 13000k -minrate 12000k -maxrate 19000k -bufsize 48000k -x264-params 8x8dct=1 -g 12 -bf 1 -preset slow -rc vbr_2pass -rc-lookahead 32 -crf 22 -flags +ilme+ildct -top 1 -c:a aac -b:a 750k -ar 48000 -aspect 16:9 -r 25 -fflags +genpts -bsf:v h264_mp4toannexb -pass 2  OUT_11_422_8bitInterlacciato%ScaledToHD%Da50Pa25i.MP4
    I try this, but I need to refine for get more quality even at the cost of greater computational complexity, how I can do?
    Quote Quote  
  4. If quality is the main aim, I'd be filtering the video to remove the noise before fussing too much over encoder settings.

    You could run QTGMC before downscaling, but it'll be even more hideously slow.

    Avisynth:

    Code:
    CropResize(1920)
    QTGMC(InputType=1, EzDenoise=2.0, Preset="very slow")
    ConvertBits(16)
    GradFun3Plus()
    ConvertBits(8, Dither=0)
    Prefetch(12)
    ffmpeg:

    Code:
    "C:\Encoders\ffmpeg\ffmpeg.exe" -i "D:\CANON.avs" -c:v libx264 -crf 19.0 -profile:v high422 -preset veryslow -x264-params colorprim='bt709':transfer='bt709':colormatrix='bt709' "D:\CANON.264"
    10.7 Mb/s:
    Image Attached Files
    Last edited by hello_hello; 18th Feb 2026 at 06:24.
    Quote Quote  
  5. Image
    [Attachment 91229 - Click to enlarge]


    grad3funplus: there is no function named "clamp"

    what can it be?
    Quote Quote  
  6. Make sure you also have the GradFun3Plus dependencies for whichever version you're using (it's probably one of more of his other functions). They're listed near the top of each script.

    https://github.com/Dogway/Avisynth-Scripts/blob/master/EX%20mods/GradFun3plus.avsi
    or
    https://github.com/Dogway/Avisynth-Scripts/blob/master/MIX%20mods/GradFun3plus.avsi

    Edit: It looks like you need his ExTools function.
    https://github.com/Dogway/Avisynth-Scripts/blob/master/ExTools.avsi
    Last edited by hello_hello; 16th Feb 2026 at 20:33.
    Quote Quote  
  7. Code:
    Import("v:\automazioneclip\AviSynth\FFMS2_26022024\FFMS2.avsi")
    LoadPlugin("V:\automazioneclip\AviSynth\FFMS2_R1363_AGO2023\X64\ffms2.dll")  
    LoadPlugin("v:\automazioneclip\AviSynth\LSMASH2026\x64\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")
    Import("v:\automazioneclip\AviSynth\CropResize\CropResize 2025-06-16.avsi")
    Import("v:\automazioneclip\AviSynth\CropResize\CropResize Resizer Functions 2025-06-16.avsi")
    Import("v:\automazioneclip\AviSynth\CropResize\CropResize Wrapper Functions 2025-06-16.avsi")
    LoadPlugin("v:\automazioneclip\AviSynth\neo_f3kdb\x64\neo-f3kdb.dll")
    LoadPlugin("v:\automazioneclip\AviSynth\neo_f3kdb\x64\dither.dll")
    LoadPlugin("v:\automazioneclip\AviSynth\neo_f3kdb\x64\avstp.dll")
    Import("v:\automazioneclip\AviSynth\neo_f3kdb\x64\dither.avsi")
    Import("v:\automazioneclip\AviSynth\neo_f3kdb\x64\mt_xxpand_multi.avsi")
    
    
    Import("c:\ExTools.avsi")
    Import("c:\1GradFun3plus.avsi")
    
    #Import("c:\2GradFun3plus.avsi")
    
    
    Import("v:\automazioneclip\AviSynth\FrostyBorders 2025-04-14\FrostyBorders Avisynth\FrostyBorders 2025-04-14.avsi")
    LoadPlugin("V:\automazioneclip\AviSynth\FFT3Dfilter\x64\fft3dfilter.dll")
    LWLibavVideoSource("temp.mkv")
    CropResize(1920)
    #GradFun3DBmod()
    #gradfun2db()
    
    ConvertBits(8, Dither=0)
    
    GradFun3Plus()
    
    #Prefetch(12)
    but now I get

    Image
    [Attachment 91239 - Click to enlarge]


    ps: I have installed AviSynthPlus_3.7.5_20250420_vcredist.exe
    Last edited by marcorocchini; 17th Feb 2026 at 03:57.
    Quote Quote  
  8. Did you check the list of dependencies at the top of the Gradfun3Plus scripts as I suggested?

    For the ExMod version:

    ### ExTools
    ### ResizersPack (for smode=0 or smode=3)
    ### MasksPack (for smode>0)
    ### DFTTest (for smode=1)

    For the MixMod version:

    ### ExTools
    ### RgTools
    ### MaskTools2
    ### ResizersPack (for smode=0 or smode=3)
    ### MasksPack (for smode>0)
    ### DFTTest (for smode=1)

    nmod is a function contained in Dogway's ResizersPack script. The MasksPack is also one of his scripts.
    Quote Quote  
  9. but I'm a cat, not a programmer. However if if use the MixMod version, for example, where I can download the

    ### ExTools
    ### RgTools
    ### MaskTools2
    ### ResizersPack (for smode=0 or smode=3)
    ### MasksPack (for smode>0)
    ### DFTTest (for smode=1)

    ?
    Quote Quote  
  10. By the way, when you installed Avisynth+ it should have created four plugin folders if you installed both the 32 bit and 64 bit versions, or two plugin folders if you only installed one of them. By default they're probably in the C:\Program Files (x86)\Avisynth+ folder. For 64 bit Avisynth, I put all the avsi functions I use in the plugins64 folder, and 64 bit dlls/plugins in the plugins64+ folder. Avisynth+ will automatically import scripts and load plugins from those folders when it runs, so you can do away with all those Import and LoadPlugin lines in your scripts.

    Just make sure for something like GradFun3Plus, where there's two version of the function, you only put one of them in the plugins folder so you can be certain which one has been loaded.
    Quote Quote  
  11. Originally Posted by marcorocchini View Post
    but I'm a cat, not a programmer. However if if use the MixMod version, for example, where I can download the

    ### ExTools
    ### RgTools
    ### MaskTools2
    ### ResizersPack (for smode=0 or smode=3)
    ### MasksPack (for smode>0)
    ### DFTTest (for smode=1)

    ?
    ExTools, ResizersPack and MasksPack are Dogway functions.
    https://github.com/Dogway/Avisynth-Scripts

    RgTools, MaskTools2 and DFTTest are plugins you'll easily find with google.
    Or just search for them here: http://avisynth.nl/index.php/Main_Page
    Quote Quote  
  12. Code:
    Import("v:\automazioneclip\avisynth\plugins\IResize.avsi")
    Import("V:\automazioneclip\AviSynth\plugins\smoothFPS2.avsi")
    Import("v:\automazioneclip\AviSynth\plugins\FrostyBorders.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")
    Import("v:\automazioneclip\AviSynth\FFMS2_26022024\FFMS2.avsi")
    LoadPlugin("V:\automazioneclip\AviSynth\FFMS2_R1363_AGO2023\X64\ffms2.dll")  
    LoadPlugin("v:\automazioneclip\AviSynth\LSMASH2026\x64\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")
    Import("v:\automazioneclip\AviSynth\GradFun3plus\ExTools.avsi")
    Import("V:\automazioneclip\AviSynth\GradFun3plus\ResizersPack.avsi")
    Import("v:\automazioneclip\AviSynth\CropResize\CropResize 2025-06-16.avsi")
    Import("v:\automazioneclip\AviSynth\CropResize\CropResize Resizer Functions 2025-06-16.avsi")
    Import("v:\automazioneclip\AviSynth\CropResize\CropResize Wrapper Functions 2025-06-16.avsi")
    LoadPlugin("v:\automazioneclip\AviSynth\neo_f3kdb\x64\neo-f3kdb.dll")
    LoadPlugin("v:\automazioneclip\AviSynth\neo_f3kdb\x64\dither.dll")
    LoadPlugin("v:\automazioneclip\AviSynth\neo_f3kdb\x64\avstp.dll")
    Import("v:\automazioneclip\AviSynth\neo_f3kdb\x64\dither.avsi")
    Import("v:\automazioneclip\AviSynth\neo_f3kdb\x64\mt_xxpand_multi.avsi")
    Import("v:\automazioneclip\AviSynth\FrostyBorders 2025-04-14\FrostyBorders Avisynth\FrostyBorders 2025-04-14.avsi")
    LoadPlugin("V:\automazioneclip\AviSynth\FFT3Dfilter\x64\fft3dfilter.dll")
    Import("V:\automazioneclip\AviSynth\GradFun3plus\GradFun3plusEX.avsi")
    #Import("V:\automazioneclip\AviSynth\GradFun3plus\GradFun3plusMix.avsi")
    LWLibavVideoSource("temp.mkv")
    CropResize(1920)
    ConvertBits(8, Dither=0)
    GradFun3Plus() # works with R4289 #
    #GradFun3()
    Prefetch(4)
    this works, but my answer is:

    for example assuming this input:

    https://www.swisstransfer.com/d/2ed82962-c2eb-4bd3-8492-4a9639dd0efe

    UHD479mbs.MXF

    is 3840x2160 50P mxf

    if i import it in edius with project settings HD50i, playback seems fine (no jittering) and export to MXF xdcamhd422 (EdiusOUT50i.MXF) seems ok. But I wonder: how would you encode it woth avisynth/ffmpeg the source to get the best 50i interlaced HD result?
    Quote Quote  
  13. For interlaced video at 25fps from a 50fps source, you'd keep the bottom field from one frame, the top field from the next one, the bottom field from the next one, and so on. The rest of the fields would be thrown away. That's why 25fps interlaced is sometimes referred to as 50i rather than 25i, as it's 50 fields per second.

    To do it in Avisynth, and it'd be better to do it after any other filtering or resizing etc:

    Code:
    CropResize(1920)
    QTGMC(InputType=1, EzDenoise=2.0, Preset="very slow")
    ConvertBits(16)
    GradFun3Plus()
    ConvertBits(8, Dither=0)
    
    # make it 25fps interlaced
    
    SeparateFields()
    A = SelectEvery(4,0)
    B = SelectEvery(4,3)
    Interleave(A,B)
    Weave()
    
    # Check whether it's TFF or BFF (most likely BFF)
    # Info()
    For x264, interlaced encoding is enabled by specifying either --tff or --bff in the command line (top or bottom field first).
    For ffmpeg it'd be tff=1 or bff=1.

    Code:
    ffmpeg.exe -i "D:\Canon.avs" -c:v libx264 -crf 19.0 -profile:v high422 -preset veryslow -x264-params bff=1:colorprim='bt709':transfer='bt709':colormatrix='bt709' "D:\Canon_Interlaced.264"
    Below is a re-encode of my earlier re-encode of your sample, using Avisynth to make it interlaced.

    BTW, your script above shows this for GradFun3Plus.

    ConvertBits(8, Dither=0)
    GradFun3Plus()

    The original GradFun3 is used to help reduce banding by converting the video to 16 bit, smoothing the gradients, then dithering it back to 8 bit. It does all that for you. Gradfun3Plus only debands, so to use it correctly you need to convert to 16 bit first, then back to the output bitdepth with dithering enabled. Dither=0 enables ordered dithering for ConvertBits().

    ConvertBits(16)
    GradFun3Plus()
    ConvertBits(8, Dither=0)
    Image Attached Files
    Last edited by hello_hello; 18th Feb 2026 at 06:40.
    Quote Quote  
  14. this is a drone 4k 50p



    jhow I can proper transcode ??

    because in my proof seems that is noticiale a lot of aliasing

    is there a way to resolve?yhanks
    Last edited by marcorocchini; 20th Feb 2026 at 03:21.
    Quote Quote  
  15. It seems okay to me. Obviously it doesn't need denoising.
    You could probably do it all in ffmpeg. I think it has a debanding filter if you still want to use one, but I've never used ffmpeg for that myself.

    Code:
    CropResize(1920)
    ConvertBits(16)
    GradFun3Plus()
    ConvertBits(8, Dither=0)
    Prefetch(8)
    Code:
    ffmpeg.exe -i "D:\4k 50p 2.avs" -c:v libx264 -crf 20.0 -preset veryslow -x264-params colorprim='bt709':transfer='bt709':colormatrix='bt709' "D:\4k 50p.264"
    Last edited by hello_hello; 20th Feb 2026 at 11:48.
    Quote Quote  
  16. your 4k 50p.mkv look fine , but is there a way to get a interlaced output 25i?
    Quote Quote  
  17. If you're referring to the huge amount of twitter when that video is converted to interlaced, I don't know the best way to fix it. It'd require some sort of low pass filter, I assume, but I wouldn't know the best way to go about it.

    Does it have to be interlaced?
    You could convert it to 25fps progressive and encode it as interlaced, or use x264's fake interlaced option (designed for when a video is progressive and you want it to appear interlaced to the player, but without encoding it as interlaced). It's used to encode some progressive formats that technically need to be interlaced for Bluray compliance.

    The fake interlaced option produces a warning from x264 if it's used for levels higher than 4.1, although it still seems to apply it anyway. I don't actually know how it works, but for YV12 video up to 1080p at 25 or 30fps, it should be fine to use.

    Code:
    SelectEven()
    CropResize(1920)
    ConvertBits(16)
    GradFun3Plus()
    ConvertBits(8, Dither=0)
    Code:
    ffmpeg.exe "D:\4k 50p 2.avs" -c:v libx264 -crf 20.0 -level 4.1 -preset veryslow -x264-params fake_interlaced=1:colorprim='bt709':transfer='bt709':colormatrix='bt709' "D:\Fake Interlaced.264"
    Last edited by hello_hello; 20th Feb 2026 at 11:49.
    Quote Quote  
  18. I tried to find out exactly what fake interlaced does, and as a result I read a few old doom9 posts were it was mentioned it should be used with --pic-struct. The closest I came to learning what that actually does is:

    It writes extra syntax elements signalling the display type of the frame (e.g. 2 fields, frame, doubling, tripling) in the picture timing sei.

    I guess it couldn't hurt to use them together, just in case. I haven't tried it myself, but I assume for ffmpeg it'd be:

    Code:
    -x264-params fake-interlaced=1:pic-struct=1
    http://www.chaneru.com/Roku/HLS/X264_Settings.htm#pic-struct

    Default: Not Set
    Force sending pic_struct in Picture Timing SEI.
    Implied when you use --pulldown or --tff/--bff.
    Recommendation: Default

    I wonder why it's not automatically enabled for fake interlaced....
    Last edited by hello_hello; 19th Feb 2026 at 05:58.
    Quote Quote  
  19. I understand the OP wants to keep the 50p motion fluidity intact by encoding it as 25i.
    FWIW here the commandline to convert the 4k 50p.mkv of post#15 to interlaced 4k 25i.mp4
    Code:
    ffmpeg -i "4k 50p.mkv" -map 0 -c:a copy -c:v libx264 -preset slow -crf 10 -flags +ilme+ildct -pix_fmt yuv420p -movflags +faststart -vf interlace,scale=interl=1,setfield=tff,setsar=1/1,format=yuv420p "4k 25i.mp4"
    Image Attached Files
    Quote Quote  
  20. Originally Posted by Sharc View Post
    the OP
    Image
    [Attachment 91265 - Click to enlarge]



    and scale to 1920x1080

    and understand if -vf scale=interl=1 is necessary even if when avisynth output is YUY2

    and get mxf xdcamhd422 profile
    Quote Quote  
  21. however I think to be solved the combination of avs + ffmpeg encoding

    LWLibavVideoSource("v:\DJI_20260219141051_0003_D.M P4")

    CropResize(1920)
    ConvertBits(8, Dither=0)
    GradFun3Plus()
    Prefetch(4)



    #CropResize(1920)
    #QTGMC(InputType=1, EzDenoise=2.0, Preset="Super Fast")
    #ConvertBits(16)
    #GradFun3()
    #ConvertBits(8, Dither=0)



    #AssumeTFF().SeparateFields().SelectEvery(4, 0, 3).Weave()

    # Check whether it's TFF or BFF (most likely BFF)
    # Info()

    Code:
    ffmpeg.exe -y -i V:\encoda2.avs -vf scale=interl=1,interlace -pix_fmt yuv422p -c:v libx264 -crf 20.0 -level 4.1 -x264-params fake_interlaced=1:pic-struct=0:colorprim=bt709:transfer=bt709:colormatrix=bt709 -an -aspect 16:9 -flags +ildct+ilme -top 1 out.mp4
    Quote Quote  



Similar Threads

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