Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
1st February 2022, 12:44 | #1 | Link |
Registered User
Join Date: Mar 2021
Posts: 84
|
How to blend video frames and place them between mainframes
I have an interlaced video stream and need blend video frames and place them between mainframes like this :
Code:
Input frames: [1] [2] [3] .....> FPS=25 | \ / | \ / | | \ / | \ / | Output frames: [1] [Bl(1,2)] [2] [Bl(2,3)] [3] .....> FPS=50 |
1st February 2022, 14:56 | #2 | Link |
Registered User
Join Date: Jul 2018
Posts: 1,180
|
If you create blends of interlaced field-based frames it will blend 4 phases of motion into single frame. Do you want to keep output FPS=50 interlaced ?
With 2 input frames (1st frame = field1+field2, 2nd frame = field3+field4) simple 2D full-height blending will create interlaced frame with field1+3, field2+4 fields. May be you need first to make deinterlacing to make 25fps frame-based stream ? If you need simply more smooth video - it is better to make motion-compensated interpolation on a sequence of separated fields and pack back to 50fps interlaced frames. The more complex and possibly better quality is to make 1. 25i->50p double rate deinterlacing (QTGMC like complex plugin) 2. 50p->100p double rate mc-interpolation (mvtools2 like mc-engine) 3. 100p->50i interlaced packing/compression (script-based transform with built-in AVS commands) Last edited by DTL; 1st February 2022 at 14:59. |
1st February 2022, 14:58 | #3 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,367
|
Is this ok?
Code:
blend = Merge(selectevery(1, 0),selectevery(1, 1)) interleave(last,blend)
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread |
1st February 2022, 15:50 | #4 | Link | |
Registered User
Join Date: Mar 2021
Posts: 84
|
Quote:
I need to get real-time smooth slow motion from i50 sources. the scan type of output does not matter, but the higher frame rate is better (I think). I tried different frame interpolation methods (like SVP , Ai ,...), but to be honest, today I realized that none of them are as smooth as vMix real-time slowmotion output. I think vMix uses a simple blending method, but I'm not an expert , if possible an expert please try vMix and tell me what method it uses? Last edited by Mitra; 1st February 2022 at 16:04. |
|
1st February 2022, 16:14 | #6 | Link |
Registered User
Join Date: Jul 2018
Posts: 1,180
|
May be vMix simply uses NVIDIA Optical Flow HWacc mc-interpolation so it outperform in quality and speed the old SVP ? NVIDIA promises good progress in Optical Flow in latest chips.
"from i50 sources. " If it is 50 fields per second - to get even smoother you need 100 fields/frames per second or more. Not very easy to make in realtime even with latest end-user CPUs for big enough frame size. Last edited by DTL; 1st February 2022 at 16:17. |
1st February 2022, 16:16 | #7 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,367
|
So you want it deinterlaced I guess, you should run first QTGMC as DTL suggested and then my code snippet. But yes, probably you want frame interpolation so you can try MysteryX's FrameRateConverter, there are better AI interpolators in VapourSynth though but haven't used them.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread |
1st February 2022, 16:33 | #8 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,992
|
Whats this look like to you ? [output 100p]
Code:
# Simple realtime AssumeTFF() # or BFF Bob() # Or alternative bob like realtime, out doublerate 50p ConvertFPS(100.0) # Blended (alternate) frames(originally fields), or some fast doublerate interpolator Code:
# Alternative Simple realtime AssumeTFF() # or BFF NED=NNedi3(Field=-2, nns=2) # Field -2 = double rate, internal parity value to start YadifMod2(Order=-1,Mode=1,edeint=NED) # Order -1 = Internal Parity. Mode 1=double rate do spactial check (3=no spatial check). ConvertFPS(100.0) # Blended (alternate) frames(originally fields), or some fast doublerate interpolator Code:
# Alternative Simple realtime AssumeTFF() # or BFF QTGMC(Preset="fast",NoisePreset="Fast",SourceMatch=2,Lossless=2,EZKeepGrain=0.4,Sharpness=0.1, tr2=0) # Boulder ConvertFPS(100.0) # Blended (alternate) frames(originally fields), or some fast doublerate interpolator
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 1st February 2022 at 17:02. |
1st February 2022, 16:38 | #9 | Link | |
Registered User
Join Date: Mar 2021
Posts: 84
|
Quote:
|
|
1st February 2022, 16:55 | #11 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,992
|
If so, then would be a requirement of vMix [no idea if it is a requirement, vmix ad should say if so].
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
1st February 2022, 22:14 | #13 | Link |
Registered User
Join Date: Mar 2021
Posts: 84
|
Thanks to all again.
Now I'm sure vMix does not use NVIDIA Optical Flow. @StainlessS, Thank you so much! QTGMC seems to be what I need, your script result is great and so better than vMix output, but so slow for real-time. I tried the "Ultra Fast" preset, but it was not fast enough yet. Do you have an idea to speed it up or improve the quality of the other your scripts? |
1st February 2022, 22:36 | #15 | Link |
Registered User
Join Date: Jul 2018
Posts: 1,180
|
If the simple double-rate deinterlace 25i to 50p is enough smooth for you and you need more speed - you can again look into NVIDIA (may be AMD too) motion-adaptive hardware deinterlace. May be already having some way to download 50p frames back to host memory and feed into your application. For simple realtime playback you can just run any player with hardware double-rate deinterlace. I typically use MPC-HC player.
There are many double-rate deinterlace onCPU plugins. I sometime use yadif (yadifmod2) http://avisynth.nl/index.php/Yadifmod2 to get double-rate deinterlaced inside AVS environment because QTGMC too complex for me to setup infinite number of required plugins. |
1st February 2022, 22:41 | #16 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,992
|
QTGMC is inherently slow,
Those settings were provided by Boulder as producing little processing/denoising, and so reasonably fast, maybe not fast enough for your machine. What machine are you playing with ? [just so the boys/and girls, have some idea] Maybe try the YadifMod2 deinterlacer thingy instead, perhaps with a HQDN3D afterwards, its fast. ConvertFPS would be about as fast as you can get for uprate 50p to 100p, if Yadifmod2 with HQDN3D is fast enough, perhaps SvpFlow might be better quality doublerater than ConvertFPS, is supposed to be better for realtime, but I dont really use it. You could always forget about 50p -> 100p, and look for better denoise. [FFT3DFilter(Sigma=1.8,Plane=0) is pretty fast, increase sigma for more denoise] The boys & girls always like a sample to play with. EDIT: And yes of course Prefetch(4) or therabouts would be a good idea at end of script [before Return Last]
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 1st February 2022 at 22:45. |
1st February 2022, 23:30 | #20 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,706
|
You can do this in any NLE (i.e., video editor). It's a lot easier. AVISynth is wonderful, but is a lousy tool for this. It takes me less than 1 second to do this in my NLE (Vegas), and I can instantly preview the effect.
|
Tags |
avisynth, blending, video |
Thread Tools | Search this Thread |
Display Modes | |
|
|