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 8th November 2013, 18:01   #1041  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
I did the test with the vpy script through using the VSimport wrapper, seems that it slows down the speed quite a lot, compared to simply threw the vpy script into virtualdub and ran analysis pass.

with wrapper:
R21 --> 30
test1 --> 35
test2 --> crash


without wrapper:
R21 --> 40
test1 --> 65
test2 --> crash
lansing is offline   Reply With Quote
Old 8th November 2013, 19:16   #1042  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by lansing View Post
I did the test with the vpy script through using the VSimport wrapper, seems that it slows down the speed quite a lot, compared to simply threw the vpy script into virtualdub and ran analysis pass.

with wrapper:
R21 --> 30
test1 --> 35
test2 --> crash


without wrapper:
R21 --> 40
test1 --> 65
test2 --> crash
If you want to test speed I really suggest you use vspipe as it will almost always have better throughput. It also shows the fps at the end now.

I'll take a serious look at it later tonight. It should be almost as fast as tdecimate at least.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 8th November 2013, 20:05   #1043  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Quote:
Originally Posted by Myrsloik View Post
If you want to test speed I really suggest you use vspipe as it will almost always have better throughput. It also shows the fps at the end now.

I'll take a serious look at it later tonight. It should be almost as fast as tdecimate at least.
I couldn't find any documentation on using vspipe on your site. I only know the most basic:

Code:
vspipe "clip.vpy" - -y4m | x264 --preset fast --demuxer y4m --output "clip.mkv" -
lansing is offline   Reply With Quote
Old 8th November 2013, 21:20   #1044  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by lansing View Post
I couldn't find any documentation on using vspipe on your site.
It prints usage instructions if you run it with no parameters. Use NUL as output file.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 9th November 2013, 02:14   #1045  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Quote:
Originally Posted by jackoneill View Post
It prints usage instructions if you run it with no parameters. Use NUL as output file.
Thanks, I got it working now
Code:
vspipe "clip.vpy" NUL
It's not so user friendly though, as it only showed the fps after the whole process was finished. not during the run.
lansing is offline   Reply With Quote
Old 10th November 2013, 13:42   #1046  |  Link
Mystery Keeper
Beyond Kawaii
 
Mystery Keeper's Avatar
 
Join Date: Feb 2008
Location: Russia
Posts: 724
https://bitbucket.org/mystery_keeper...te-vapoursynth
Mature enough, or still needs improvements?
__________________
...desu!
Mystery Keeper is offline   Reply With Quote
Old 10th November 2013, 16:24   #1047  |  Link
sl1pkn07
Pajas Mentales...
 
Join Date: Dec 2004
Location: Spanishtán
Posts: 496
Hi Mystery Keeper

what is stdbool.h?

http://sl1pkn07.no-ip.com/paste/view/97611430

howto build? "gcc -o templinearapproximate.so main.c -I/usr/include/vapoursynth -I"put here stdbool.h path" ?

greetings
sl1pkn07 is offline   Reply With Quote
Old 10th November 2013, 16:42   #1048  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by sl1pkn07 View Post
what is stdbool.h?
Support for the "bool" type as well as the "true" and "false" constants in C language:
http://pubs.opengroup.org/onlinepubs...stdbool.h.html

It's required, because C did not have a "bool" type before C99. Legacy code might still use "bool", "true" and "false" for other purposes, since they were not reserved before C99.

So if you want C++-style booleans in C, you have to include <stdbool.h> or just define those three macros yourself. MSVC still doesn't support C99
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 10th November 2013 at 16:59.
LoRd_MuldeR is offline   Reply With Quote
Old 10th November 2013, 17:13   #1049  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by Mystery Keeper View Post
https://bitbucket.org/mystery_keeper...te-vapoursynth
Mature enough, or still needs improvements?
https://bitbucket.org/mystery_keeper...=master#cl-196

The variable frames and planes can be allocated on the stack as an array of size 3. There will never be more than 3 planes in a format.

You should be able to eliminate most other allocations as well using variable length arrays since you went with C99.


https://bitbucket.org/mystery_keeper...=master#cl-208

You should pass input frame n instead of NULL. Otherwise all the existing properties such as colorimetry and times won't be copied over to your output frame.


"planes:int[]: opt:empty;" <- you probably don't want empty there, it's most likely an error if a user wants to filter no planes


https://bitbucket.org/mystery_keeper...=master#cl-114

"tla" should be "TempLinearApproximate". It makes more sense if the name reported when an error happens also matches the function used to create the filter.

That's all I could see. The only other small comment I have that should probably be ignored is that this would be a good function to implement with templates in C++ to avoid repeating it.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 10th November 2013, 17:20   #1050  |  Link
sl1pkn07
Pajas Mentales...
 
Join Date: Dec 2004
Location: Spanishtán
Posts: 496
oks, build with

gcc -shared -fPIC -std=c99 -o templinearapproximate.so main.c -I/usr/include/vapoursynth

missing -shared and -fPIC

sorry. i'm not coder

greetings and thanks
sl1pkn07 is offline   Reply With Quote
Old 10th November 2013, 17:40   #1051  |  Link
Mystery Keeper
Beyond Kawaii
 
Mystery Keeper's Avatar
 
Join Date: Feb 2008
Location: Russia
Posts: 724
Quote:
Originally Posted by Myrsloik View Post
"planes:int[]: opt:empty;" <- you probably don't want empty there, it's most likely an error if a user wants to filter no planes
Actually intentional for testing purpose. Thank you for advices!
Also, silly me. Didn't free write pointers. That would cause a memory leak, so if anyone's already using it - you should update.
__________________
...desu!

Last edited by Mystery Keeper; 10th November 2013 at 17:52.
Mystery Keeper is offline   Reply With Quote
Old 10th November 2013, 18:02   #1052  |  Link
handaimaoh
Guest
 
Posts: n/a
Quote:
Originally Posted by Reel.Deel View Post
And finally, someone started to port RemoveDirt to VS.
And it's getting close. I've ported it enough that it compiles. I just need the next couple of days to get the ASM ported to intrinsics (and most of it is pretty straightforward so it shouldn't be too hard) then to test it. The only other thing is that kassandro's RemoveDirt script (as of versions .8 and above it's merely a script around some functions in RemoveDirt and RemoveGrain) for Avisynth requires modes 16 and 17 in RemoveGrain. So before it can be used I'll work on implementing those modes for vsremovegrain since it currently doesn't support those modes.
  Reply With Quote
Old 11th November 2013, 13:46   #1053  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,666
Hi handaimaoh, welcome to the forum.

Great news about your progress/plans for RemoveDirt.
Regarding SCSelect what's your thoughts about adding functionality to be able to output a scene change log
and also make it compatible so that other plugins can use it as their scene change detector? (Similar to Chikuzen's scenechange plugin)
Reel.Deel is offline   Reply With Quote
Old 11th November 2013, 14:21   #1054  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by Reel.Deel View Post
Hi handaimaoh, welcome to the forum.

Great news about your progress/plans for RemoveDirt.
Regarding SCSelect what's your thoughts about adding functionality to be able to output a scene change log
and also make it compatible so that other plugins can use it as their scene change detector? (Similar to Chikuzen's scenechange plugin)
SCSelect should never be ported. It's trivial to write as a script using FrameEval and PlaneDifference. It only calculates the sum of absolute differences to make its decision.

Note that Chikuzen's scenechange plugin also uses the absolute difference and should produce almost identical results. If you want the relative threshold mode as well just write a feature request Chikuzen.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet

Last edited by Myrsloik; 11th November 2013 at 14:26. Reason: One more thing
Myrsloik is offline   Reply With Quote
Old 11th November 2013, 14:55   #1055  |  Link
handaimaoh
Guest
 
Posts: n/a
Yeah, it will likely just get removed. It was only ported over simply for being able to test everything and the fact that it was like 2 minutes of effort since it was pretty simple.
  Reply With Quote
Old 11th November 2013, 16:15   #1056  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
Quote:
Originally Posted by Myrsloik View Post
SCSelect [...] only calculates the sum of absolute differences to make its decision.
Does it? The documentation states otherwise, Didée too (here). I have to say that 2nd order differences are much more reliable, from my experience. Anyway, I don’t know if it’s better to compute the scene change using 3 input frames each time (dedicated plug-in) or to save the first order differences on additional temporary frames, wasting memory for these trivial operations.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 11th November 2013, 16:52   #1057  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by cretindesalpes View Post
Does it? The documentation states otherwise, Didée too (here). I have to say that 2nd order differences are much more reliable, from my experience. Anyway, I don’t know if it’s better to compute the scene change using 3 input frames each time (dedicated plug-in) or to save the first order differences on additional temporary frames, wasting memory for these trivial operations.
The relevant code for selecting:
Code:
			if( dirmult * olddiff < lastdiff ) goto set_end;
			if( dirmult * lastdiff < olddiff ) goto set_begin;
olddiff and and lastdiff are the absolute difference to the previous/next frame. I suppose that does make it second order but it's still trivial to recreate.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 11th November 2013, 17:42   #1058  |  Link
mastrboy
Registered User
 
Join Date: Sep 2008
Posts: 365
There's a speed difference between SCSelect and using Avisynth's built-in runtime functions (xDifferenceFromPrevious/xDifferenceToNext), SCSelect is quite faster, no idea if the same would apply to vapoursynth's internal functions though...
__________________
(i have a tendency to drunk post)
mastrboy is offline   Reply With Quote
Old 11th November 2013, 18:07   #1059  |  Link
handaimaoh
Guest
 
Posts: n/a
Quote:
Originally Posted by mastrboy View Post
There's a speed difference between SCSelect and using Avisynth's built-in runtime functions (xDifferenceFromPrevious/xDifferenceToNext), SCSelect is quite faster, no idea if the same would apply to vapoursynth's internal functions though...
Before any final decision is made I'll do some speed tests. If SCSelect is still substantially faster it'll be kept around until something else can replace it. It's not a ton of code as is.
  Reply With Quote
Old 11th November 2013, 18:23   #1060  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
SCSelect_Like function in script (behaves identically and not very good) from here:- http://forum.doom9.org/showthread.ph...23#post1644023

Code:
Avisource("D:\avs\test.avi")

# RemoveDirt's SCSelect(clip input, clip scene_begin, clip scene_end, clip global_motion, float dfactor, bool debug, bool planar)

Function SCSelect_Like(clip dclip,clip Start,clip End,clip Motion, float "dfactor",bool "debug") {
    # Start, End, Motion MUST all be same, dclip can be other colorspace/size (unlike SCSelect).
    dfactor=Float(Default(dfactor,4.0))
    debug=Default(debug,false)
    Global SCM_A=0.0 Global SCM_B=0.0 Global SCM_SC=0 Global SCM_Prev=-1
    Motion.ScriptClip("""
        NotNext = (current_frame!=SCM_Prev+1)
        Global SCM_A=(NotNext)? RT_LumaDifference(dclip,dclip,n=current_frame-1,n2=current_frame)  : SCM_B
        Global SCM_B=           RT_LumaDifference(dclip,dclip,n=current_frame,n2=current_frame+1)
        # 0 = Start of scene, 1 = End of scene, 2 = Global motion
        Global SCM_SC=(current_frame==FrameCount-1)?1:(SCM_A>dfactor*SCM_B || current_frame==0)?0:(SCM_B>dfactor*SCM_A)?1:2
        (SCM_SC==0) ? Start : (SCM_SC==1) ? End : Last      # Choose Start, End or Motion(ie Last)
        (debug)?RT_Subtitle("%d ] %6.2f %6.2f SC=%d",current_frame,SCM_A,SCM_B,SCM_SC):NOP
        Global SCM_Prev=current_frame
        Return Last
    """,args="dfactor,Start,End,Dclip,debug")          # Needs Grunt for args
    return Last
}

Start=Subtitle("START OF SCENE",align=3,size=30)
End=Subtitle("END OF SCENE", align=1,size=30)
Motion=Subtitle("GLOBAL MOTION",align=5,size=30)
L=SCSelect_Like(Last,Start,End,Motion,debug=true)
R=SCSelect(Last,Start,End,Motion)
StackHorizontal(L,R)
__________________
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 ???
StainlessS 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 12:19.


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