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 > VapourSynth
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 25th September 2012, 11:35   #201  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by Are_ View Post
Transpose crashes python.exe
vs-v8(redownload)
python-3.2.3
That's not much to go on. It crashes with different input formats? Does your cpu have sse2?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 25th September 2012, 11:51   #202  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
Yeah, sorry for my poor report, after further testing:

Input is yv12 coming from native ffms2 (BD m2ts)
As long as the total sum of pixels is less than 2000000, it does not seem to crash (only played a little resizing before Transpose)
Tested on my amd cpu and an i3 friends's one, both with sse2
Are_ is offline   Reply With Quote
Old 25th September 2012, 15:21   #203  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by Are_ View Post
Yeah, sorry for my poor report, after further testing:

Input is yv12 coming from native ffms2 (BD m2ts)
As long as the total sum of pixels is less than 2000000, it does not seem to crash (only played a little resizing before Transpose)
Tested on my amd cpu and an i3 friends's one, both with sse2
Will be fixed in the next release.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 25th September 2012, 17:41   #204  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by HolyWu View Post
Seems "global" is a special statement to Python, how could I get around this? TIA.

Code:
>>> super = core.avs.MSuper(clip, mt=False)
>>> bvec2 = core.avs.MAnalyse(super, isb=True, delta=2, blksize=16, overlap=8, mt=False, truemotion=False, global=True)
  File "<stdin>", line 1
    bvec2 = core.avs.MAnalyse(super, isb=True, delta=2, blksize=16, overlap=8, mt=False, truemotion=False, global=True)
                                                                                                                ^
SyntaxError: invalid syntax
>>>
You can put all the arguments in a dict and then pass the dict as function(**dict)
I'll think about what to do with it in the next version. Maybe some kind of automatic argument renaming would be a good idea...
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 25th September 2012, 19:49   #205  |  Link
-Vit-
Registered User
 
Join Date: Jul 2010
Posts: 448
Finally had time to try some scripting, ultimate aim to get (Q)TGMC working. Hit some problems:

- No Bob, Merge or TemporalSmooth
-- I cannot replace Bob with the SeparateFields/Resize equivalent because the resizers don't support float sample offsets as they do in Avisynth
-- Merge can be replaced with masktools calls, but will be slower
-- TemporalSmooth can be kinda replaced with trim and masktools work, but will be much slower and really needs scene change awareness. Any suggestions for an existing external plugin that does the same (MVTools can do it with null vectors, but that seems overkill), or does it need a new plugin to be written?

- I have a problem with Interleave (unless I'm being stupid). This script should do nothing, but actually returns a clip with (almost?) every other frame dropped:
Code:
#...
e = core.std.SelectEvery(clip=c,cycle=2,offsets=[0]) # SelectEven
o = core.std.SelectEvery(clip=c,cycle=2,offsets=[1]) # SelectOdd
c = core.std.Interleave(clips=[e,o])
#...
- Changelog says unnamed parameters are now accepted, how?
-Vit- is offline   Reply With Quote
Old 25th September 2012, 20:25   #206  |  Link
hajj_3
Registered User
 
Join Date: Mar 2004
Posts: 1,126
python 3.3 will be out within 1 week btw, RC3 is currently out so you can switch to VS2010 once that is released
hajj_3 is offline   Reply With Quote
Old 25th September 2012, 21:16   #207  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by -Vit- View Post
Finally had time to try some scripting, ultimate aim to get (Q)TGMC working. Hit some problems:

- No Bob, Merge or TemporalSmooth
-- I cannot replace Bob with the SeparateFields/Resize equivalent because the resizers don't support float sample offsets as they do in Avisynth
-- Merge can be replaced with masktools calls, but will be slower
-- TemporalSmooth can be kinda replaced with trim and masktools work, but will be much slower and really needs scene change awareness. Any suggestions for an existing external plugin that does the same (MVTools can do it with null vectors, but that seems overkill), or does it need a new plugin to be written?

- I have a problem with Interleave (unless I'm being stupid). This script should do nothing, but actually returns a clip with (almost?) every other frame dropped:


- Changelog says unnamed parameters are now accepted, how?
Code:
e = core.std.SelectEvery(c,2,[0]) <- that's all there is to it, simple
It's well known that the resizers suck. I'm looking into several different options to fix it.

You're right. No bob. Maybe you can use some other bob filter and tweak the settings to make it really stupid.

I plan to start work on a kind of masktools replacement based on asmjit after R9 is released, it should be a good base for making the merge functionality you want.

Temporalsmooth is also just another temporal smoother. I don't think it belongs as a base filter.

Maybe someone will come along and rip out some of avisynth's more popular filters and make them standalone plugins. I think it's the best interim solution.

I found the interleave bug. A complete brainfart at its best when it was written.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet

Last edited by Myrsloik; 25th September 2012 at 21:41.
Myrsloik is offline   Reply With Quote
Old 25th September 2012, 23:26   #208  |  Link
-Vit-
Registered User
 
Join Date: Jul 2010
Posts: 448
Quote:
Originally Posted by Myrsloik View Post
Code:
e = core.std.SelectEvery(c,2,[0]) <- that's all there is to it, simple
I tried that and get this:
TypeError: __call__() takes exactly 0 positional arguments (3 given)
-Vit- is offline   Reply With Quote
Old 25th September 2012, 23:40   #209  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
You most likely have an old version lying around without realizing it. Delete all copies of vapoursynth.pyd and vscore.dll and reinstall.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 26th September 2012, 00:37   #210  |  Link
-Vit-
Registered User
 
Join Date: Jul 2010
Posts: 448
So I did. I should know better...
-Vit- is offline   Reply With Quote
Old 26th September 2012, 02:55   #211  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
here's a replacement for bob, at least using avisynth code (i haven't had time to teach myself python yet):

interleave(separatefields().selecteven().bicubicresize(last.width,last.height,1/3.,1/3.,0,.25,last.width,last.height/2),separatefields().selectodd().bicubicresize(last.width,last.height,1/3.,1/3.,0,-.25,last.width,last.height/2))

i think vapoursynth should have enough internal filters to implement the above line, if the resizers are up to it.
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 26th September 2012, 03:17   #212  |  Link
AzraelNewtype
Registered User
 
AzraelNewtype's Avatar
 
Join Date: Oct 2007
Posts: 135
Quote:
Originally Posted by Mug Funky View Post
here's a replacement for bob, at least using avisynth code (i haven't had time to teach myself python yet):

interleave(separatefields().selecteven().bicubicresize(last.width,last.height,1/3.,1/3.,0,.25,last.width,last.height/2),separatefields().selectodd().bicubicresize(last.width,last.height,1/3.,1/3.,0,-.25,last.width,last.height/2))

i think vapoursynth should have enough internal filters to implement the above line, if the resizers are up to it.
The resizers only handle integer offset values, it's literally the problem -Vit- said he had with trying to implement it by hand himself.
AzraelNewtype is offline   Reply With Quote
Old 26th September 2012, 11:12   #213  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
I've released R9. See http://www.vapoursynth.com/2012/09/r9-the-mostly-done-release/ for the full post with changes and what's on my todo list.

Here's a small example of the new slicing possible with clips in Python:
Code:
clip[1:] # equivalent to Trim(c, first=1)
clip[:9] # equivalent to Trim(c, last=8)
clip[1::2] #equivalent to selecting all frames with odd numbers
clip[::-1] # Reverse(c)
Interleave([clip[::2], clip[1::2]]) # do "nothing"
clip1[200::-5]  + clip2[5:10:3] # ponder this one
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet

Last edited by Myrsloik; 26th September 2012 at 11:29.
Myrsloik is offline   Reply With Quote
Old 26th September 2012, 13:53   #214  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,843
Can't wait to see vfw module, even if I'm still not sure how useful it will be
kolak is offline   Reply With Quote
Old 26th September 2012, 15:44   #215  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by HolyWu View Post
The slicing result seems to be wrong or do i do anything wrong
You found the single case where I forgot to adjust the trim end appropriately (with only stop and not start set). I've reuploaded R9 with that small detail fixed.

Note that clip[0:9] will give you the correct result even in the broken version.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 26th September 2012, 16:29   #216  |  Link
-Vit-
Registered User
 
Join Date: Jul 2010
Posts: 448
Trying to do some temporal scripting. Couple of queries:
- SelectEvery fails if any selected frame is negative (doesn't seem to be so much a problem at the clip end...?). Avisynth duplicates the start/end frames, so allowing "out-of-cycle" offsets. This is used by many avisynth scripts. Without it, temporal processing at the clip ends becomes trickier.
- Related, SelectEvery does not accept a cycle of 1. For selecting the clip offset by a number of frames: SelectEvery(c,1,[-2])

- Negative slice start and end values? I thought they counted from the end of the sequence. Seems to reject them here. Exacerbates the above two points because the workarounds involve padding at the start and the end.

- Suggestion: * operator for clip repetition. c * 2 = clip repeated twice.

Last edited by -Vit-; 26th September 2012 at 16:36.
-Vit- is offline   Reply With Quote
Old 26th September 2012, 17:08   #217  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by -Vit- View Post
Trying to do some temporal scripting. Couple of queries:
- SelectEvery fails if any selected frame is negative (doesn't seem to be so much a problem at the clip end...?). Avisynth duplicates the start/end frames, so allowing "out-of-cycle" offsets. This is used by many avisynth scripts. Without it, temporal processing at the clip ends becomes trickier.
- Related, SelectEvery does not accept a cycle of 1. For selecting the clip offset by a number of frames: SelectEvery(c,1,[-2])

- Negative slice start and end values? I thought they counted from the end of the sequence. Seems to reject them here. Exacerbates the above two points because the workarounds involve padding at the start and the end.

- Suggestion: * operator for clip repetition. c * 2 = clip repeated twice.
Trim splice and repeat is for offsetting a clip. Why you need selectevery to do so is a bit of a mystery to me. Seems like you're stuck in your avisynth ways. I suppose I could allow out of cycle offsets in selectevery if you have a good use case.
Also, negative offsets in slicing is just crazy. It goes against all that is good and python. Use clip[clip.num_frames - 10, clip.num_frames - 5, -1] If you need something similar. I intentionally kept trim simple. Look at the mess in avisynth and you'll see why.
I'll think about a repeat operator but it's a lot less common for someone to need it. I want to keep it simple and avoid operator overloading hell.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 26th September 2012, 18:56   #218  |  Link
-Vit-
Registered User
 
Join Date: Jul 2010
Posts: 448
I'm was trying to do a 2-radius temporal smooth in script for TGMC. The trick is the clip ends, where there aren't enough frames. Naturally I started with the avisynth approach because it deals with that trivially; and there are no complex vapoursynth script examples - you gotta start somewhere.

Quote:
Originally Posted by Myrsloik View Post
Also, negative offsets in slicing is just crazy. It goes against all that is good and python.
I rarely code Python so I don't have that Pythony mindset... but negative indices are allowed in ordinary Python list slicing so why are they not good Python?

Quote:
Originally Posted by Myrsloik View Post
I'll think about a repeat operator but it's a lot less common for someone to need it. I want to keep it simple and avoid operator overloading hell.
It's useful for the padding needed at the ends of the clip I needed to implement the above. I guess it can be done with slice+loop. But you go against expectations by providing some list operators and not others (I immediately went for the * operator and I'm not a Pythoner)
-Vit- is offline   Reply With Quote
Old 26th September 2012, 19:03   #219  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by -Vit- View Post
I'm was trying to do a 2-radius temporal smooth in script for TGMC. The trick is the clip ends, where there aren't enough frames. Naturally I started with the avisynth approach because it deals with that trivially; and there are no complex vapoursynth script examples - you gotta start somewhere.


I rarely code Python so I don't have that Pythony mindset... but negative indices are allowed in ordinary Python list slicing so why are they not good Python?


It's useful for the padding needed at the ends of the clip I needed to implement the above. I guess it can be done with slice+loop. But you go against expectations by providing some list operators and not others (I immediately went for the * operator and I'm not a Pythoner)
Right, I missed the part with negative indexes. It will be added. I try to be pythonish whenever possible. I suppose I'll add * too just to see how it turns out.

As for scripts I suggest you post a few lines of avisynth script here and I'll tell you how it'd write it. I'm actually surprised so few people ask me about the syntax.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 27th September 2012, 21:54   #220  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
ok i'lve read all 12 pages of this thread, and i have the script ready in a py file. But how do you run it with different codec like xvid, divx and x264? I mean how do I write it in the command window? And how do I measure the speed of each filters without outputing the video file?

And there's no link in the documentation page that redirect back to the homepage

Last edited by lansing; 27th September 2012 at 21:57.
lansing is offline   Reply With Quote
Reply

Tags
speed, vaporware, vapoursynth


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


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