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. |
9th November 2011, 23:37 | #1501 | Link | |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 712
|
Quote:
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding |
|
11th November 2011, 04:38 | #1503 | Link |
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,718
|
The new build seems to work fine, thanks
Do you have any plans to improve MVTools further, like making it possible to use blocksize 24? -Vit- created the plugin which could be used to scale vectors but it would be nice to have native support for something between sizes 16 and 32.
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... |
11th November 2011, 18:20 | #1504 | Link |
Registered User
Join Date: Aug 2006
Location: Stockholm/Helsinki
Posts: 805
|
I'm trying to use the motion blur effect in this plugin to convert 60fps video game footage into Youtube-friendly 30fps.
But I'm not really satisfied with the result. No matter how short I make the "time interval", the high-detailed slow-moving background gets totally blurred. There doesn't seem to be anything wrong with the motion vectors. Is it possible to skip all vectors that are shorter than some threshold? That way I can blur any fast-moving objects, while keeping the detailed background. Or is this possible somehow with MMask? |
11th November 2011, 19:47 | #1505 | Link |
Registered User
Join Date: Jul 2010
Posts: 448
|
QTGMC will do that kind of motion blur for you (without doing any other processing):
Code:
QTGMC( "Slower", InputType=1, fpsDivisor=2, \ ShutterBlur=2, ShutterAngleSrc=0, ShutterAngleOut=90, SBlurLimit=6, \ TR0=0, TR1=0, TR2=0, Rep0=0, Rep2=0, SMode=0, SLMode=0, Sbb=0, NoiseProcess=0, SourceMatch=0, Lossless=0 ) 2nd line is the motion blur settings. Game source likely has no blur so ShutterAngleSrc = 0, ShutterAngleOut sets output blur level (0-360), SBlurLimit does what you want, will not blur regions moving slower than this value pixels per frame 3rd line switches off everything else in QTGMC ___ Or if you want to do it yourself use MMask, basic idea below (assuming you will add a SelectEven() before or after): Code:
clip=last ... # Calculate super clips, vectors fVec1, bVec1... blurClip = MFlowBlur( ... ) BlurLimit = 6 # Blocks moving less than BlurLimit pixels per frame will not be blurred motionMask = MMask( clip, bVec1, kind=0, ml=BlurLimit ) output = mt_merge( clip, blurClip, motionMask, U=3,V=3 ) Last edited by -Vit-; 11th November 2011 at 21:04. Reason: clarity |
11th November 2011, 20:09 | #1506 | Link |
Registered User
Join Date: Sep 2011
Posts: 86
|
Have you tried just SelectEven()? Many people prefer the cinematic shuttering to soap-opera smoothness.
Code:
super = MSuper() backward_vectors = MAnalyse(super, isb = true) forward_vectors = MAnalyse(super, isb = false) blurred=MFlowBlur(super, backward_vectors, forward_vectors, blur=45).SelectEven() shuttered=SelectEven() mask=MMask(forward_vectors, kind=0, ml=10) overlay(blurred,shuttered,mask=mask) |
12th November 2011, 05:52 | #1508 | Link |
Registered User
Join Date: Aug 2006
Location: Stockholm/Helsinki
Posts: 805
|
I've already tried merging the blurred and non-blurred images with a MMask(kind=0,...) mask, and didn't like the results.
An object moving over a non-moving background will be surrounded by zeroes in the mask. The object will be blurred within the object itself (where the mask is non-zero), but its movement over the static background won't be blurred. (The video game is Super Smash Bros Melee. It looks horrible after a simple SelectEven because it's a very fast-moving game. Many people have liked the motion blur I've been using, but others including myself hate how it completely destroys the detailed slow-moving backgrounds) Last edited by ajp_anton; 12th November 2011 at 05:54. |
12th November 2011, 07:29 | #1509 | Link |
Registered User
Join Date: Jul 2010
Posts: 448
|
Perhaps combine forward and backward masks. And also the backwards mask from the previous frame and the forward mask from the next frame...? [It's the non-intuitive way round...]
Or do a MFlowBlur on the mask itself! |
12th November 2011, 07:48 | #1510 | Link |
Registered User
Join Date: Sep 2011
Posts: 86
|
Code:
c = last # blur == amount of blur, percentage # 200 - fully open shutter (doubled because of SelectEven) # 0 - no blur (ie SelectEven) blur = 50 # motion == what blurs # 0 - everything blurred # small values - small motion treated as static # large values - only high motion treated as moving # 255 - nothing blurred (ie SelectEven) motion = 10 super = MSuper(c) b_vec = MAnalyse(super, isb = true) f_vec = MAnalyse(super, isb = false) blurd = MFlowBlur(c, super, b_vec, f_vec, blur=blur) # hopefully looking forward and backwards will help the problem # you were having with occlusion fmask = MMask(c, f_vec, kind=0, ml=motion) bmask = MMask(c, b_vec, kind=0, ml=motion) mask = mt_logic(fmask, bmask, mode="or", U=3, V=3) output = mt_merge(c, blurd, mask, U=3, V=3) output.SelectEven() |
12th November 2011, 14:23 | #1511 | Link |
Registered User
Join Date: Aug 2006
Location: Stockholm/Helsinki
Posts: 805
|
Combining masks doesn't work if the object moves more than its size for each frame, because then the object's mask will still be completely surrounded by zero-motion.
But also blurring the mask sounds very interesting! Will try that soon. Thanks. |
12th November 2011, 18:14 | #1512 | Link |
Registered User
Join Date: Sep 2011
Posts: 86
|
Here is another option, blending to cause ghosting.
Code:
# http://ajpanton.se/ssbm/ajp_anton/TAS/ ffvideosource("DrMario_AR_13.08.mp4") c = last.assumefps("ntsc_double") # blur == amount of blur, percentage # 200 - fully open shutter (doubled because of SelectEven) # 0 - no blur (ie SelectEven) blur = 50 # motion == what blurs # 0 - everything blurred # small values - small motion treated as static # large values - only high motion treated as moving # 255 - nothing blurred (ie SelectEven) motion = 10 super = MSuper(c.blur(1.5)) b_vec = MAnalyse(super, isb = true) f_vec = MAnalyse(super, isb = false) #blurd = MFlowBlur(c, super, b_vec, f_vec, blur=blur) blur2 = convertfps("ntsc_quad").SelectOdd() fmask = MMask(c, f_vec, kind=0, ml=motion).trim(1,0) bmask = MMask(c, b_vec, kind=0, ml=motion) mask = mt_logic(fmask, bmask, mode="or", U=3, V=3) output = mt_merge(c, blur2, mask, U=3, V=3) output.SelectEven() |
14th November 2011, 23:27 | #1513 | Link |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 712
|
Adding blksize=24 looks a bit complicated for now. There are zillions of lines of code to write or adapt, this would be a pretty long task. I'm currently trying to make MVTools natively multithreaded, at least the MAnalyse part, and haven't done any significant progress so far by lack of time. However I am now more familiar with the code and know more accurately what to do and how. I also almost finished writing something allowing to safely load and save the vector clips. It will be useful to test filters quickly: generate the vectors once for a given clip, then reload them during the filtering pass for quick access. The downside is the size of the vector file which is really huge, like a lossless clip.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding Last edited by cretindesalpes; 14th November 2011 at 23:32. |
15th November 2011, 01:48 | #1514 | Link | |
Registered User
Join Date: Jul 2010
Posts: 448
|
Quote:
MVExtras 0.21 Contains source and some instructions. The vector storage combines as many vector clips as you want into a single encodable clip, which you then save out lossless. Read it back in as a source and you can extract the vector clips you want. Requires a lossless RGBA encoder - I only know of Lagarith. May be better to save to a custom file format, but I needed some compression and this was the quickest way. Definitely want some kind of compression for this otherwise the vector files become unusably large. Anyway, it might be relevant to whatever you add to MVTools. You might consider adding some vector scaling functions too, they are quite useful and MVTools used to contain something similar. |
|
15th November 2011, 08:40 | #1515 | Link |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 712
|
Oh! I was aware of the scaling function, but didn't know for the store/restore vectors. I'll definitely check how to integrate your modifications to mine.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding |
15th November 2011, 18:26 | #1516 | Link | |
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,718
|
Quote:
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... |
|
15th November 2011, 19:25 | #1517 | Link | |
Registered User
Join Date: Jul 2010
Posts: 448
|
Quote:
Can't remember which version of the vector scaling I previously released (it was not intended for release before the next QTGMC, which uses it). The version above has had a number of changes, maybe it resolves your observation. |
|
15th November 2011, 20:28 | #1518 | Link |
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,718
|
Here's two sample frames where you can see the difference quite clearly:
http://img38.imageshack.us/img38/5058/normal1j.png http://img3.imageshack.us/img3/8531/scaled1.png http://img832.imageshack.us/img832/9183/normal2k.png http://img853.imageshack.us/img853/5264/scaled2.png I used this script to compare: Code:
DGSource("batman1.dgi") clip=last clipScaled = clip.BicubicResize( clip.Width()/2, clip.Height()/2 ) superScaled = clipScaled.MSuper( pel=2, hpad=0,vpad=0 ) bVecScaled = superScaled.MAnalyse( blksize=8, isb=true, overlap=4 ) fVecScaled = superScaled.MAnalyse( blksize=8, isb=false, overlap=4 ) bVec = bVecScaled.MScaleVectors( 2 ) fVec = fVecScaled.MScaleVectors( 2 ) supersc = clip.MSuper( pel=2, hpad=0,vpad=0 ) fvecnormal = supersc.MAnalyse(blksize=16,overlap=8,isb=false) bvecnormal = supersc.MAnalyse(blksize=16,overlap=8,isb=true) interleave(MShow(supersc,fvecnormal),MShow(supersc,fvec))
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... |
15th November 2011, 21:23 | #1519 | Link |
Registered User
Join Date: Jul 2010
Posts: 448
|
That looks like differences due to the analysis blocksize - it's mainly affecting blocks with little detail, which can be matched quite freely. More freely when the blocksize is small. You should compare the vectors before and after they were scaled - that's what the plugin does and so those clips should be equivalent. The plugin cannot guarantee that a search with a larger image/blocksize will be identical to a search with a smaller image/blocksize - that's down to the operation of MVTools. Although in practice those searches are similar enough for some purposes. Vector scaling will be used for faster QTGMC presets on HD material.
Change the last line in your script to show original vectors, then small image vectors, then scaled vectors: Code:
interleave(MShow(supersc,fvecnormal), MShow(superScaled,fVecScaled).Spline36Resize(clip.Width(), clip.Height()), MShow(supersc,fvec)) Last edited by -Vit-; 15th November 2011 at 21:49. |
16th November 2011, 17:50 | #1520 | Link |
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,718
|
I did some more testing with that rather noisy HD clip and it seems that I need to lower the denoising settings quite a bit to not oversmooth the image. Regarding this (and kind of out of topic here), is there a quick way to control how much denoising is done (like a percent of full effect)? Using limit=1 in MDegrain1 is still too much in some parts of the image.
EDIT: is it ok to use the unscaled clip as the pelclip (if pel=2) in the scaled MSuper call?
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... Last edited by Boulder; 16th November 2011 at 17:53. |
Thread Tools | Search this Thread |
Display Modes | |
|
|