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

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 29th March 2011, 15:49   #541  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Hollola, Finland
Posts: 4,324
Quote:
Originally Posted by -Vit- View Post
Boulder: I always use my own mods of all the plugins which include SEt's fixes and a nasty hack of my own. They do help, but I haven't had a chance to thoroughly test in order to release. As they have all been converted to VS2010/Intel builds so there is scope for problems - I already get enough support queries on QTGMC...
Any chance you could release masktools-25.dll or -26.dll for testing? It seems that most of my crashes in VDub point to that dll.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline  
Old 29th March 2011, 16:30   #542  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,377
Quote:
Originally Posted by Didée View Post
Code:
Lanczos4resize(720,576) 
AssumeTFF() #choose the SAME field order like before deinterlacing 
Blur(0,1).SeparateFields().SelectEvery(4,0,3).Weave() #reinterlace.
Would there be any advantage (or disadvantage) in doing the Blur before the resize?

Given you have to vertically blur the results, is there in fact any point in using (Q)TGMC for deinterlacing just in order to do an re-interlaced downsize? Would an 'inferior' but faster deinterlacer give equally good results, or do you still gain something from the temporal processing of (Q)TGMC?

Quote:
Originally Posted by Boulder View Post
Any chance you could release masktools-25.dll or -26.dll for testing? It seems that most of my crashes in VDub point to that dll.
I suspect that is simply because most of the time in QTGMC is spent inside masktools, so that's usually where it is when it runs out of memory or gets a bad pointer from the Avisynth cache. However, it is important to use the right version (25 or 26) to match your Avisynth.
__________________
GScript and GRunT - complex Avisynth scripting made easier

Last edited by Gavino; 29th March 2011 at 16:34.
Gavino is offline  
Old 29th March 2011, 18:16   #543  |  Link
-Vit-
Registered User
 
Join Date: Jul 2010
Posts: 448
This is a modded MaskTools 2.0a46 for Avisynth 2.5x which might be more stable with multithreading:

VS2010 | Intel C++ 2011 | Source

I believe the VS2010 version is more stable (hard to tell really). It is a bit slower though. [each Visual Studio compiler since around VS2005 generates slower code than the one before - what's that about? Profile-guided optimization doesn't help...]

All plugins started from a clean build and had all known bug fixes added (SEt's). The nasty hack: I removed the exception caused when the plugin finds that the frame it was about to work on is already in use. Instead the thread sleeps for a while and tries again ... it tries several times until the frame is free... and if that fails it just processes the frame anyway. Very ugly, I know. I can give you no guarantees at all that this will help you. You will still get out of memory conditions if you run too many threads or overburden the Avisynth cache.

Last edited by -Vit-; 30th March 2011 at 18:14.
-Vit- is offline  
Old 29th March 2011, 18:26   #544  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Hollola, Finland
Posts: 4,324
Thanks, I'll test the file as soon as my next crash occurs. I've been trying to bob Queen Live at the Wembley for at least fifteen times this evening, and having a long video with lots of motion doesn't help at all..
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline  
Old 30th March 2011, 12:43   #545  |  Link
hydra3333
Registered User
 
Join Date: Oct 2009
Location: crow-land
Posts: 446
Quote:
Originally Posted by Gavino View Post
1. Would there be any advantage (or disadvantage) in doing the Blur before the resize?

2. Given you have to vertically blur the results, is there in fact any point in using (Q)TGMC for deinterlacing just in order to do an re-interlaced downsize? Would an 'inferior' but faster deinterlacer give equally good results, or do you still gain something from the temporal processing of (Q)TGMC?
I'd be interested in knowing 'expert' the answers to these questions too. I suspect with 1, it might be a lot slower but I'm not sure of the gain.

Also interestingly, this much faster Brute-Force approach doesn't suffer from the QTGMC jaggies and looks "reasonable".
I really should compare the QTGMC-blur with this brute-force, side by side...
Code:
# BRUTE-FORCE PURE VERSION PER http://forum.doom9.org/showthread.php?p=1185790#post1185790  
Global NewHeight=576 
Global NewWidth=720 
SeparateFields()  
Shift = (GetParity() ? -0.25 : 0.25) * (Height()/Float(NewHeight/2)-1.0) 
E  = SelectEven().Spline36resize(NewWidth, NewHeight/2, 0,    Shift) 
O  = SelectOdd( ).Spline36resize(NewWidth, NewHeight/2, 0,   -Shift) 
Ec = SelectEven().Spline36Resize(NewWidth, NewHeight/2, 0,  2*Shift) 
Oc = SelectOdd( ).Spline36Resize(NewWidth, NewHeight/2, 0, -2*shift) 
Interleave(E, O) 
IsYV12() ? MergeChroma(Interleave(Ec, Oc)) : Last 
Weave() 
AssumeTFF()

edit: Compared with stackhorizontal and frame-by-frame - the QTGMC-noblur looks nicest and sharpest in places with no motion however in places of motion with lines it is striking in how the jaggies stand out. The QTGMC-blur and Brute-Force appear almost identical to most intents and purposes (relatively clean 1440x1080i source). So... in this instance with this type of source with the intent of an interlaced size reduction from HDi to SDi, I can attain circa 20x the speed by abandoning QTGMC and going brute-force. Obvious I suppose, but as a dummy I'd thought "yeah, I want quality, just knock it about with QTGMC to get a great deinterlaced image for size-reduction and reinterlacing".

Last edited by hydra3333; 30th March 2011 at 13:53.
hydra3333 is offline  
Old 30th March 2011, 14:16   #546  |  Link
sadie
Registered User
 
Join Date: Sep 2006
Posts: 55
Just thought I'd pop in and let you know that after opening v. 3.31 for the first time I'm getting a 'script error: there is no function name "interleaved2planar" ' referencing line 351. Both in Vdub and avidemux. I'm still using DirectShowsource. Thanks
sadie is offline  
Old 30th March 2011, 15:32   #547  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
Quote:
Originally Posted by -Vit- View Post
I only have the dll and can't provide source code for the changes at the moment, but thankfully masktools is license-free.
You are not correct with GPL again.

See readme.txt in masktools-v2.0a48.zip :
Quote:
The source code is released as gpl.
gpl.txt (v2) is included too.
__________________
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  
Old 30th March 2011, 16:17   #548  |  Link
-Vit-
Registered User
 
Join Date: Jul 2010
Posts: 448
sadie: You must have YUY2 input, which is why Interleaved2Planar is required. Looks like you are missing SSE3Tools. Look in the OP and either download the plugins package from the top of the post, or get the individual SSE3Tools plugin from the list further down.

hydra3333: "QTGMC jaggies", grrrr... The problem was with your original reinterlacing script. The second script you're using does a better job of downscaled reinterlacing. However, it assumes an interlaced source. If you want to start from a progressive source (e.g. including one that you've bobbed) just replace the "SeparateFields()" line with "SeparateFields().SelectEvery(4,0,3)"

I.e. If you want to deinterlace first (for some temporal processing perhaps?) then your second script starts thus:
Code:
QTGMC(...settings...) #Or whatever bobber
SeparateFields().SelectEvery(4,0,3)
# rest of that second script
Probably there's a simplification to be made to the remainder of the script in the progressive case, but it will do...

Fizick: :sigh: Done.
I did look, but missed it - that reference is tucked away, and omitted from many places where you would expect it (the source code doesn't mention it). That would affect enforceability for certain cases.

Last edited by -Vit-; 30th March 2011 at 18:21.
-Vit- is offline  
Old 30th March 2011, 17:40   #549  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
-Vit-, I ask you to distribute plugins archives "as is", with source codes and documentation (it is useful for end user and contains copyright).
__________________
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  
Old 30th March 2011, 18:18   #550  |  Link
sadie
Registered User
 
Join Date: Sep 2006
Posts: 55
Thanks, Vit, but alright, now that's done I merely get a "mt-makediff: unsupported color space, masktools only supports planar YUV color spaces..." error. Evidently, YUY has finally crept in after all these years. Mediainfo though still tells me I've got an indeterminate 'YUV'. Oddly, the same error now occurs with my earlier project of several weeks ago that like all the projects I've done since the beginning of time were discreetly processing at YV12. We're still talking about a simple DV import by the way. It shouldn't be YUY AT ALL, should it? OK, since my last project I'd removed my older NLE for an upgrade of the same brand, and have also replaced an earlier version of ffdshow tryouts for the latest official ffdshow (in order to make a stab at their little makeavis.exe... which didn't work either of course). I think a new DV codec filter has slipped into MP Player classic as well. I know this problem is at the edge of this thread's topic but if someone has a generalist's intuition as to what might have entropied my configuration I'd be mighty appreciative.
sadie is offline  
Old 30th March 2011, 20:11   #551  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Hollola, Finland
Posts: 4,324
Quote:
Originally Posted by Boulder View Post
Thanks, I'll test the file as soon as my next crash occurs. I've been trying to bob Queen Live at the Wembley for at least fifteen times this evening, and having a long video with lots of motion doesn't help at all..
It seems that the dll has a positive effect on stability. At least I was able to finish one encode in one go and the second one (the Queen b*****d) crashed once quite early on and after lowering the number of threads by one, has now been going on for over 3.5 hrs. Let's see if it finishes OK, it has 8 hours to go.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline  
Old 30th March 2011, 20:53   #552  |  Link
-Vit-
Registered User
 
Join Date: Jul 2010
Posts: 448
Quote:
Originally Posted by Fizick View Post
-Vit-, I ask you to distribute plugins archives "as is", with source codes and documentation (it is useful for end user and contains copyright).
Yes certainly, you only needed to ask.

sadie: I don't know how YUY has crept into your workflow, but your error is strange. You should have only got that Interleaved2Planar error if your source is YUY2 (or at least Avisynth thinks it is). And once you got the missing plugin, your clip should have been converted to the special planar YUY2 format that masktools has accepted since Alpha 34. Which begs the question: do you have an up to date masktools2? If you do then something odd is afoot and I'd like to see a sample of that clip...

Last edited by -Vit-; 30th March 2011 at 22:47.
-Vit- is offline  
Old 31st March 2011, 02:02   #553  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,377
Quote:
Originally Posted by -Vit- View Post
hydra3333: "QTGMC jaggies", grrrr... The problem was with your original reinterlacing script. The second script you're using does a better job of downscaled reinterlacing. However, it assumes an interlaced source. If you want to start from a progressive source (e.g. including one that you've bobbed) just replace the "SeparateFields()" line with "SeparateFields().SelectEvery(4,0,3)"

I.e. If you want to deinterlace first (for some temporal processing perhaps?) then your second script starts thus:
Code:
QTGMC(...settings...) #Or whatever bobber
SeparateFields().SelectEvery(4,0,3)
# rest of that second script
Isn't QTGMC(...).SeparateFields().SelectEvery(4,0,3) the same as (but much slower than) a simple SeparateFields()? (and with some quality loss, given the latter is lossless.)

Or are you saying it only makes sense to do this if you had some temporal processing between QTGMC and SeparateFields()?

What are your thoughts on my earlier question:
Quote:
Originally Posted by Gavino View Post
is there in fact any point in using (Q)TGMC for deinterlacing just in order to do an re-interlaced downsize? Would an 'inferior' but faster deinterlacer give equally good results, or do you still gain something from the temporal processing of (Q)TGMC?
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline  
Old 31st March 2011, 02:28   #554  |  Link
-Vit-
Registered User
 
Join Date: Jul 2010
Posts: 448
Quote:
Originally Posted by Gavino View Post
Isn't QTGMC(...).SeparateFields().SelectEvery(4,0,3) the same as (but much slower than) a simple SeparateFields()? (and with some quality loss, given the latter is lossless.)
Er... yes... scratch that thought. Well, not quite, you do get temporal effects in the original fields as well as deliberate adjustments to help fit the interpolated fields (it's not quite "quality loss"). But that's only very marginally helpful.

I don't have time (nor, it would seem, the ability) to think about this deeply right now, but I had the gut feeling that something like that sub-pixel shifted rescale in the script above could be done on a progressive source. Then separate fields/weave on the reduced size image to give a more usable result. Kinda what I was hinting at at the end of that other post.

And I completely agree that there doesn't seem to be too much point doing elaborate bobbing. Maybe you might avoid certain aliasing in the result if you interpolate properly at the higher resolution?
-Vit- is offline  
Old 31st March 2011, 06:14   #555  |  Link
sadie
Registered User
 
Join Date: Sep 2006
Posts: 55
Vit, your indulgence as always is appreciated. My problem was indeed linked to an update of ffdshow. Quite simply their internal DV decoder had become unchecked causing Windows to default to an unidentifiable (MS?) 3rd party codec (with its config menu in Chinese no less, always a good sign).Also, I've got Pinnacle, Canopus and DVCPro dv decoding filters in MPlayerC, but oddly can get none of them to kick in. Curious to know what decoder/encoder combo you show in MPlayer when opening the clip I posted a few weeks back. Anyway, now it's back to trying to get a Makeavis dummy file to open in Premiere/Pinnacle.
sadie is offline  
Old 31st March 2011, 11:04   #556  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 852
Hi all!

I am from YUY2 world.
SeT 2.6 build + mt_masktools_26.dll do not work with YUY2 colorspace, error from masktools function mt_makedif, mt_masktools_25.dll and Vit modded dll work without problem.
SSE3Tools more unstable comparing to SSE2tools (VirtualDub crash when push Start button at job list, SSE2Tools work before 1.5 hour SD material), using save AVI work but for small clip.


yup.
yup is offline  
Old 31st March 2011, 13:04   #557  |  Link
hydra3333
Registered User
 
Join Date: Oct 2009
Location: crow-land
Posts: 446
Quote:
Originally Posted by -Vit- View Post
hydra3333: "QTGMC jaggies", grrrr... The problem was with your original reinterlacing script. The second script you're using does a better job of downscaled reinterlacing. However, it assumes an interlaced source. If you want to start from a progressive source (e.g. including one that you've bobbed) just replace the "SeparateFields()" line with "SeparateFields().SelectEvery(4,0,3)"

I.e. If you want to deinterlace first (for some temporal processing perhaps?) then your second script starts thus:
Code:
QTGMC(...settings...) #Or whatever bobber
SeparateFields().SelectEvery(4,0,3)
# rest of that second script
Probably there's a simplification to be made to the remainder of the script in the progressive case, but it will do...
Huh ? It is an interlaced source. What was wrong with the 1st script to make you go grrrr ? This thread http://forum.doom9.org/showthread.ph...41#post1110741 talks about re-interlacing from a double-framerate deinterlaced clip and I gathered SeparateFields().SelectEvery(4,0,3).Weave() was the way to reinterlace the double-framerate progressive clip which QTGMC produced. I also recall reading recommendations that resizing an interlaced clip is best done by deinterlacing it first and then reinterlacing after the resize.... which I did with QTGMC /resize/reinterlace.

Last edited by hydra3333; 31st March 2011 at 13:07.
hydra3333 is offline  
Old 31st March 2011, 13:37   #558  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,390
@hydra - did you see my comment about colorizing a B/W picture, then printing it to a B/W printer? That was not a mere joke. That was an analogy.

For purposes of downscaling,
Code:
xdest = 720
ydest = 576 # or 480
Spline36resize(xdest,last.height)
Bob(newheight=ydest).SelectEvery(4,0,3).Weave()
does a pretty fair job. Anything more exhaustive will yield only marginal improvement.

For the (very rare) case of interlaced upscaling, like 576i -> 1080i, it's a completely different story.

Main point#1 is that an interlaced source has 50% of data missing (not considering lowpassing). QTGMC is a sophisticated method to interpolate those missing 50% as good as possible.
At the moment you do re-interlacing, you are throwing away 50% of the data again. Poof!

Main point #2 is the kind of de-interlacing used during playback of an interlaced stream. Most realtime deinterlacers are using rather "simple" methods, and therefore can't cope well with "sharp" interlaced sources. That's why lowpassing usually is done before re-interlacing. This makes the job for the deinterlacer much more easy, so even the most simple ones can deliver an acceptable result.
__________________
- 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  
Old 31st March 2011, 22:01   #559  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: UK
Posts: 2,183
I still can't use QTGMC for HD sources. Got my new 12 core machine, but can't use it with QTGMC, because it's crashing all the time. Tried to move to 64bit, but couldn't make it working at all- Vdub could not understand incoming video.

Last thing which I did not try is avisynth 2.6- is it much more likely to work or not?

Thanks
kolak is offline  
Old 1st April 2011, 00:10   #560  |  Link
-Vit-
Registered User
 
Join Date: Jul 2010
Posts: 448
yup: Thanks for that detail, that might partly explain sadie's problem. I'll investigate to see if there is anything I can do in the YUY2/avisynth 2.6 domain. The SSE2Tools info is useful, I didn't experience any issues but I haven't tested much YUY2. It makes sense since RemoveGrainSSE3 had problems around that time too.

kolak: Yes, you should try every Avisynth version. For HD input, if can be a good idea to start at 4 threads, 1 EdiThread and work up. Try my modded MaskTools above, see if it helps. I have a whole set of those modded plugins if people are finding them useful.

hydra3333: Just meaning to say that QTGMC doesn't create the jaggies in your original script, the subsequent statements do. If you started with a sharp progressive source instead of QTGMC you would get the same effect. Didee's script can work with any bobber but it doesn't work out of the box, this is the intent
[EDIT: This isn't correct - see later posts for correct script]:
Code:
xdest = 720
ydest = 576 # or 480
Spline36resize(xdest,last.height)
Bob(height=ydest/2).AssumeFieldBased().Weave()
and with QTGMC:
Code:
xdest = 720
ydest = 576 # or 480
Spline36resize(xdest,last.height)
QTGMC(...settings...).Spline36Resize(xdest,ydest/2).AssumeFieldBased().Weave()
Little difference if ydest is much smaller than the original height, and almost the same as any other working variant.

Last edited by -Vit-; 1st April 2011 at 02:42.
-Vit- is offline  
Closed Thread

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 19:51.


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