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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 7th November 2007, 18:35   #521  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
mroz,
probably it may be done, but i do not know how and it is not in my "to do" list.

Th most intrigue for me is returning array

mv=MVAnalayse(source)
array=MVGlobal(mv) # like MVDepan
dx=array[0] # in conditional env
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick
I usually do not provide a technical support in private messages.
Fizick is offline   Reply With Quote
Old 7th November 2007, 20:03   #522  |  Link
mroz
Registered User
 
mroz's Avatar
 
Join Date: Sep 2006
Posts: 201
Ok, fair enough. I don't think there's anything special about runtime functions - I tried calling one outside of a conditional environment & as long as you manually define current_frame to some value it will work.

So it should be 'just' a matter of defining the function as you would normally do, but return an integer or array, as you prefer, instead of a clip.

Of course as I've never written a plugin & have only dipped a toe into poking around in MEncoder's handling of AVISynth script input, the 'just' is not so small for me

Ah well, never mind.

Oh, I did notice in the MVTools MVDepan source there's some logging code. Any idea how I turn that on? Is it a compile time option?
mroz is offline   Reply With Quote
Old 7th November 2007, 23:12   #523  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
MVTools 1.8.5 (05.11.2007 by Fizick)
Added pelsearch parameter as search parameter (radius) at finest level (request by Terranigma). Default=pel
Decreased internal buffer to decrease memory usage, with some changes in critical sections.
Added block size 16x2 (requested by ab_99).

I do not merge latest 1.8.4.3 code by TSP.
I independenly developed similar solution (probably worse, but I must firstly read and undestand TSP circular buffer concept).


mroz, MVDepan is very old code.
My codes are ugly, but my English is even more, so please read a code.
Brobably the simplest solution is to add some func to MVDepan code to output array
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick
I usually do not provide a technical support in private messages.

Last edited by Fizick; 7th November 2007 at 23:15.
Fizick is offline   Reply With Quote
Old 7th November 2007, 23:40   #524  |  Link
superuser
Registered User
 
Join Date: Sep 2006
Posts: 84
Quote:
Originally Posted by Fizick View Post
superuser, it is delayed.
Now I consider Terranigma's request.
sure, thanks for the update. I was going through that another where you had posted about MVDegrain3 and was excited about it. But I agree the point raised by Taerranigma's is higher priority. I will wait no probs .

Last edited by superuser; 7th November 2007 at 23:42.
superuser is offline   Reply With Quote
Old 8th November 2007, 00:16   #525  |  Link
Terranigma
*Space Reserved*
 
Terranigma's Avatar
 
Join Date: May 2006
Posts: 953
Quote:
Originally Posted by Fizick View Post
MVTools 1.8.5 (05.11.2007 by Fizick)
Added pelsearch parameter as search parameter (radius) at finest level (request by Terranigma). Default=pel
Thanks so much for this. I'm now getting the speed I was once accustomed to with 1.7.0.
Terranigma is offline   Reply With Quote
Old 9th November 2007, 00:39   #526  |  Link
mroz
Registered User
 
mroz's Avatar
 
Join Date: Sep 2006
Posts: 201
Quote:
Originally Posted by Fizick View Post
mroz, MVDepan is very old code.
My codes are ugly, but my English is even more, so please read a code.
Brobably the simplest solution is to add some func to MVDepan code to output array
No worries

If I pluck up the courage I'll have a play with the code. Can you recommend build tools? What do you use to compile MVTools?
mroz is offline   Reply With Quote
Old 10th November 2007, 17:53   #527  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
mroz,
Any Microsoft compler since VCToolkit 2003, plus Platorm SDK.

Probably my MVGlobal suggestion instead of MVDepan is bad.
It is not possible to return array.
And every MVGlobalDx, MVGlobalDy... will ineffective recalculate global motion.
So, your suggestion of separate function (plugin) MVPepanDx(MVDepan()) is better.

But it also may be implemented as (global) variables (MVDepanDx, ... ) in MVDepan like "current_frame".
I can implement it. But should its names to be fixed or user defined (for every MVDepan instance) ?
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick
I usually do not provide a technical support in private messages.
Fizick is offline   Reply With Quote
Old 10th November 2007, 20:11   #528  |  Link
Terka
Registered User
 
Join Date: Jan 2005
Location: cz
Posts: 677
how to mask (by black) areas which move
1. less then treshold in both directions (sqr(x^2+y^2));
2. in vertical direction only?
Terka is offline   Reply With Quote
Old 10th November 2007, 23:58   #529  |  Link
mroz
Registered User
 
mroz's Avatar
 
Join Date: Sep 2006
Posts: 201
Quote:
Originally Posted by Fizick View Post
mroz,
Any Microsoft compler since VCToolkit 2003, plus Platorm SDK.

Probably my MVGlobal suggestion instead of MVDepan is bad.
It is not possible to return array.
And every MVGlobalDx, MVGlobalDy... will ineffective recalculate global motion.
So, your suggestion of separate function (plugin) MVPepanDx(MVDepan()) is better.
If it is, then only by chance. I thought your idea to return an array was better, so I must have very little idea of what's going on - which doesn't surprise me ;(

Quote:
But it also may be implemented as (global) variables (MVDepanDx, ... ) in MVDepan like "current_frame".
I can implement it. But should its names to be fixed or user defined (for every MVDepan instance) ?
Eek, not sure. Anyone else?

Would appending string(idx) to Dx etc be enough? Though I suspect I've again revealed how little I understand.

Edit: no sorry, that's obviously not helpful. I guess the names would need to be user defined. Sorry, had a few drinks.

BTW Thanks for considering this

Last edited by mroz; 11th November 2007 at 00:05.
mroz is offline   Reply With Quote
Old 11th November 2007, 21:31   #530  |  Link
superuser
Registered User
 
Join Date: Sep 2006
Posts: 84
Difference between MVFlowFPS(2) & SelectEven(Odd)

If MVFlowFPS/MVFlowFPS2 is used to bring down the framerate to half, in this case does MVFlowFPS/MVFlowFPS2 will select the same frames as SelectEven or SelectOdd would had? If not who different will it behave be. I tried differentiating between both of the approaches, but it was not clear to me, so posted this question here.

When using MVFlowFPS2 on would following be a good approach to follow:


Code:
numerator = dcSrcFramerateNumerator()/2
denominator = dcSrc.FramerateDenominator()/2
#
backward_vec = dcSrc.MVAnalyse(isb = true, truemotion=true, pel=2, idx=1, delta=1, search=3)
forward_vec = dcSrc.MVAnalyse(isb = false, truemotion=true, pel=2, idx=1, delta=1, search=3)
backward_vec2 = dcSrc.MVAnalyse(isb = true, truemotion=true, pel=2, idx=2, delta=2, search=3)
forward_vec2 = dcSrc.MVAnalyse(isb = false, truemotion=true, pel=2, idx=2, delta=2, search=3)
dcSrc = dcSrc.MVFlowFps2(backward_vec,forward_vec,backward_vec2,forward_vec2,num=numerator, den=denominator, idx=1, idx2=2)
or MVFlowFPS2 has been crafted to take vectors on cropped frames which depends on the block size used in MVAnalyze?

Last edited by superuser; 11th November 2007 at 21:35.
superuser is offline   Reply With Quote
Old 12th November 2007, 01:23   #531  |  Link
talen9
Registered User
 
Join Date: Aug 2007
Location: Italy
Posts: 286
I *think* that, using that script, you're not changing FPS at all

The FPS value is given by (numerator)/(denominator), right? So, dividing both of them by 2, the resulting "new" FPS will be ... the same as the original one

I think that you'll need to change it a bit ... like, you'll have to divide by 2 the numerator and keep unchanged the denominator:

Code:
numerator = dcSrcFramerateNumerator()/2
denominator = dcSrc.FramerateDenominator()
...
talen9 is offline   Reply With Quote
Old 12th November 2007, 01:28   #532  |  Link
mroz
Registered User
 
mroz's Avatar
 
Join Date: Sep 2006
Posts: 201
Double the denominator rather than halve the numerator, else you'll have a problem when the numerator is odd.
mroz is offline   Reply With Quote
Old 12th November 2007, 11:45   #533  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,529
The way you use it is just an extremely slow no-op. Flow will use the input frame if it matches up perfectly with the output. What you probably want is to use mvflowblur(...).selecteven() instead, so that you lengthen the shutter to compensate for lowering the framerate. (Films generally have longer shutters than DV, it's an important part of the 'film look' everyone treasures.)

If not, you're going to have to explain what you're looking for.
__________________
There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order.
foxyshadis is offline   Reply With Quote
Old 12th November 2007, 15:54   #534  |  Link
superuser
Registered User
 
Join Date: Sep 2006
Posts: 84
Quote:
Originally Posted by talen9 View Post
I *think* that, using that script, you're not changing FPS at all

The FPS value is given by (numerator)/(denominator), right? So, dividing both of them by 2, the resulting "new" FPS will be ... the same as the original one

I think that you'll need to change it a bit ... like, you'll have to divide by 2 the numerator and keep unchanged the denominator:

Code:
numerator = dcSrcFramerateNumerator()/2
denominator = dcSrc.FramerateDenominator()
...
Quote:
Originally Posted by mroz View Post
Double the denominator rather than halve the numerator, else you'll have a problem when the numerator is odd.
thnxs for pointing that out. In my scripts I m using it first doubling the framerate (using Bobber), and than bring it back to the original framerate. I have detailed why below why I am doing so. Though again this methodology may not be the appropriate way to do it


Quote:
Originally Posted by foxyshadis View Post
The way you use it is just an extremely slow no-op. Flow will use the input frame if it matches up perfectly with the output. What you probably want is to use mvflowblur(...).selecteven() instead, so that you lengthen the shutter to compensate for lowering the framerate. (Films generally have longer shutters than DV, it's an important part of the 'film look' everyone treasures.)

If not, you're going to have to explain what you're looking for.
Thnxs, I will try this out.

Details of what I trying to do: Currently I am processing a movie about 3 hours run time. The problem with these movies are released as NTSC, but they were converted from PAL. So as to over-come poorly interlaced frames effects, what I had in mind is first double the framerate, in my case was using yadiff for the same (2*29.97), than bring the framerate to original using mvflowfps (29.97). With this frames looked much better and smoother than before. I am using DVD-RB and CCE as the encoder. Had tried for manual encoding CCE so as to encode as Film, but I did not get it right so reverted back to DVD-RB. The idea of playing with framerate being is do not disturb the output framerate, keep it same as the input one and deinterlace them, if the above is the appropriate one to follow. I had used DVD-RB's features for deinterlacer, but the results were not that soothing, so am exploring other options which can work with DVD-RB.

Again I am in learning process so feel free to slam the ideas or approach which does not seem appropriate.

thxs once again for ur input and I will try out what Foxyshadis suggested.
superuser is offline   Reply With Quote
Old 12th November 2007, 16:17   #535  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,394
Quote:
Originally Posted by superuser View Post
The problem with these movies are released as NTSC, but they were converted from PAL.
Usually such conversions are done either by normal pulldown, or by a converter box that produces field-blending.
For the former you should use IVTC, for the latter you should use MRestore (or Restore24, or RePal).
Motion compensated Yabba-dabba-doo most times is of zero use in this context.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 12th November 2007, 16:32   #536  |  Link
superuser
Registered User
 
Join Date: Sep 2006
Posts: 84
Thnxs Didee for the input.

Quote:
Originally Posted by Didée View Post
Usually such conversions are done either by normal pulldown, or by a converter box that produces field-blending.

Would normal Pull-down work with DVD-RB? Also if possible can you please where can I find information


Quote:
Originally Posted by Didée View Post
For the former you should use IVTC, for the latter you should use MRestore (or Restore24, or RePal).
Motion compensated Yabba-dabba-doo most times is of zero use in this context.
Above is what I had started with and I was getting shaky or not much clear frames, so I switched to above approach. But I was bringing the framerate back to the original which of the limitation of the process I am following . When I get back to my place, I will post the what calls I was using (I was making calls to tritical's TDient plugins for the same).
superuser is offline   Reply With Quote
Old 12th November 2007, 22:56   #537  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,173
You first need to identify your input.
Code:
xxxSource("file")
Assume?ff() # choose TTF or BFF
Bob()
Step thru the Bobbed fields looking for the pattern of how moving parts are rendered. If the original was 24 fps film then you should be able to decern how it has become intertwined with video field structure. If the motion steps 2 forwards then 1 backward then use the other TFF/BFF.

E.g. If it is simple 3-2 pulldown from the dumb bob you will see Frame1, dup1, dup1, Frame2, dup2, Frame3, dup3, dup3, Frame4, Dup4, Frame5, ...

Or if field blending has occured Frame1, dup1, blend12, Frame2, Frame3, blend34, Frame4, ....

Once you have your pattern then you can start reseaching how to recover the original frames. Didée has offered 2 prime candidates.
IanB is offline   Reply With Quote
Old 13th November 2007, 02:22   #538  |  Link
Terranigma
*Space Reserved*
 
Terranigma's Avatar
 
Join Date: May 2006
Posts: 953
Fizick, is there any way to use dct=1 on all frames except those at scene changes? That's only where oscillation occurs.

---
OK, I noticed that there's only errors when using dct 1, 2, & 4 during backward searches; I wonder why that is

Last edited by Terranigma; 13th November 2007 at 03:10. Reason: correction of wording.
Terranigma is offline   Reply With Quote
Old 13th November 2007, 17:37   #539  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
Terranigma,
Please provide (much) more info.
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick
I usually do not provide a technical support in private messages.
Fizick is offline   Reply With Quote
Old 18th November 2007, 13:51   #540  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
mroz, Ii can implement motion info as AviSynth global variables (via SetGlobalVar in internal code):

...
MVDePan(..,vdx="dx")
ScriptClip(last,"Subtitle(String(dx))",after_frame=true)

or as local variables:

...
dx=0.0 # must be initialized in this case
MVDePan(..,vdx="dx")
ScriptClip(last,"Subtitle(String(dx))",after_frame=true)

What is better for MT environment?
probably first, but some trick may be needed anyway if you want different names for difrerent threads.
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick
I usually do not provide a technical support in private messages.
Fizick is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:50.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.