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 Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 7th November 2017, 06:48   #1  |  Link
Robert Martens
Registered User
 
Join Date: Feb 2010
Location: New York
Posts: 116
SickJumps - Speed ramp/time remapping plugin

Download

Speed ramping for Avisynth. Or "time remapping" if you want to sound smart. This plugin:
  • Processes both video and audio
  • Lets you specify how long, in seconds, each output ramp should last
  • Allows separate start and end speeds (e.g. start at 1x, speed up to 8x, then come back down to 3x on the way out)
  • Optionally sets a script variable per-frame for the runtime environment, should you want to overlay the current input frame number, or the speed multiplier (sample script included with source)
  • Keeps no state between GetFrame or GetAudio calls, and should be MT friendly, assuming I haven't done too many ass-backward things

Requires Avisynth 2.6 or Avisynth+, as well as the Visual C++ 2015 Redistributable. I won't link that here, new versions are released periodically and the link would get stale quickly.




Time to brush the cobwebs off this account! According to the little widget I haven't logged in for over two years. Yikes. Not trying to be a stranger, just not much going on plugin wise.

Until now! Like so many people I've caught the Let's Play bug, and a video I worked on back in September called for some fast-forwards. Almost ten hours of wandering around a custom Quake map (The Forgotten Sepulcher, from the latest update to Arcane Dimensions; if you like old games but haven't played it, get to stepping) had me desperate to save people the trouble. Plain cuts would have been serviceable, but they lose the ability to see what I did during the lost time. Speed increases are a nice compromise, since if they're not too severe you can still get a sense of where the player's going and what they're doing; that's my main focus with the videos I upload, to show mappers and modders what an ordinary rube does when he plays their map sight unseen.

In the past I'd either jumped straight to full speed, or stepped up in big chunks, but I wanted a smooth increase this time, for my fanciest pants production yet. Researching the issue led me to a couple of threads:

https://forum.doom9.org/showthread.php?t=151567
https://forum.doom9.org/showthread.php?p=1512077

What I could piece together from those, unfortunately, didn't process both video and audio, let me dictate the output timing (i.e. specify that the resulting ramp should take X seconds), or allow non-linear ramps. I haven't managed to crack that last one yet, since my first attempt used Invoke to call Avisynth's Spline function, but after a bit I had to refactor some things and that became unfeasible. I could have replaced it with my own straight C++ spline function, but I would have had to write tests and make sure everything worked as expected, and I was burning out on this project, so I just stripped that out for now. I only mention it because it was a motivation to write a custom solution.

That solution started as a script, trying to harness ChangeFPS and TimeStretch, but I couldn't beat the latter into submission in that form, with audio blips all over the place. I eventually decided to bite the bullet, abandon my dream of pitch preservation, and just write a plugin. About two weeks after recording that gameplay footage, I'd finished a hacky preliminary version, put the video together, and uploaded it: https://www.youtube.com/watch?v=8GKwLZZATVI See the description for some timestamps marking various points of interest, namely the speed changes.

After that, I had a Quake map of my own to get back to making, but I wanted this plugin polished up and released first. We all know how that goes. "A few last fixes" turns into "tangents and distractions and rabbit holes, oh my", and suddenly it's been literally five more weeks. Bit of advice: when the Avisynth header says INT24 audio "is a stupid thing to code", it's not kidding. Jesus Christ. I still don't know if I'm testing that right, but it sounds like it works, so yay! Let's turn off the lights and leave before everything blows up.

As much fun as I've had here over the years learning Avisynth, and tinkering with plugins, I can't say I'll definitely be hanging around more frequently than I have since 2015, but I found this plugin useful, and thought it was worth sharing. Enjoy! Or don't, I'm not your mother.

Last edited by Robert Martens; 7th November 2017 at 10:56.
Robert Martens is offline   Reply With Quote
Old 21st November 2017, 16:05   #2  |  Link
Sparktank
47.952fps@71.928Hz
 
Sparktank's Avatar
 
Join Date: Mar 2011
Posts: 912
This is pretty neat!
Especially for game captures.

This is the kind of thing I've been looking for ever since FoxSearchLight did a teaser for Night Watch (Nochnoy Dozor) 2014 release in North America:

Relive Night Watch in 2.5 Minutes
https://www.youtube.com/watch?v=5kaWbTtB31A
__________________
Win10 (x64) build 18362| GPU Caps Viewer 1.42.4.0
NVIDIA GeForce GTX 1060 3GB (GP106) 3071MB/GDDR5 | (r435_95-4)
NTSC | DVD: R1 | BD: A
Intel Xeon X5660 @2.80GHz
Sparktank is offline   Reply With Quote
Old 26th November 2017, 21:57   #3  |  Link
Yanak
Registered User
 
Join Date: Oct 2011
Posts: 275
Hello,
Thanks a lot for this plugin, this is something really helpful that i missed on many occasions too, especially for gaming stuff.

I have only lightly tested it for now, only on video stuff without audio for now, getting nice results but there is something that i don't understand :

On the documentation there is float "end_multiplier" that we can add as last parameter, supposed to do this :
**end_multiplier** float, default start_multiplier
- The speed multiplier to use after the ramp down.


After testing a few times it seems this isn't working, if i try to add this last parameter after the "down_seconds" one it returns me an error message " Invalid Argument" Am i doing something wrong ?

I almost always operated my audio separately but will have to try video+audio processed all in avisynth using this script in the next days, also need to dig into the script variable possibilities and learn about this but it seems to offer nice possibilities.

Until now when i needed accelerated portions of video like this i used to speed up my footage progressively inside vegas but max speed is limited there, so i extracted the portion of video speeded up, played in a video player using maximum forward speed while recording the output with Fraps to achieve high acceleration like this tool allows it, then reimporting the portion of speeded up video recorded with Fraps into my project and frameserving all the resulting montage to avisynth , this will make it way more easy, even if i play less and less or record stuff like this nowadays

Anyways, thanks a lot for this tool, really nice job done on this.

Last edited by Yanak; 26th November 2017 at 21:59.
Yanak is offline   Reply With Quote
Old 27th November 2017, 02:15   #4  |  Link
Robert Martens
Registered User
 
Join Date: Feb 2010
Location: New York
Posts: 116
Quote:
Originally Posted by Yanak View Post
On the documentation there is float "end_multiplier" that we can add as last parameter, supposed to do this :
**end_multiplier** float, default start_multiplier
- The speed multiplier to use after the ramp down.


After testing a few times it seems this isn't working, if i try to add this last parameter after the "down_seconds" one it returns me an error message " Invalid Argument" Am i doing something wrong ?
Yes, I believe so. If you use positional arguments, the parameter after down_seconds is script_variable, which expects a string; end_multiplier comes after that. You'll either need to specify a script variable name and then go on to use a float for the end multiplier, or just use e.g. end_multiplier=3.0.

I did it that way, instead of putting end_multiplier immediately after full_multiplier in the parameter list, because I assume most people won't need end_multiplier. With end_multiplier all the way at the end of the list, people can call the plugin without having to manually specify a dummy value for that parameter in order to continue using positional arguments for everything after it. It does make things slightly more inconvenient for the few who do use end_multiplier, though, so my apologies.

Glad you've found the plugin useful so far! Your previous workflow sounds like a bit of a chore, I hope SickJumps turns out to be a suitable replacement.
Robert Martens is offline   Reply With Quote
Old 27th November 2017, 12:13   #5  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 7,360
Yanak,

When posting a problem with filter args, you best supply exact line of script that fails, RobertMartens should not have to guess what you are doing,
you also assist yourself when doing such.
__________________
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
Old 27th November 2017, 13:18   #6  |  Link
Yanak
Registered User
 
Join Date: Oct 2011
Posts: 275
@StainlessS:
Indeed i should have posted my command directly to make it more clear and easier to understand, sorry for that, won't forget the next time i will need to ask about an issue, thank you.

@Robert Martens :
No need to apology, if one needs to do so it's me.

Got it working now, I was trying to simply add the value at the end, without having the script part before.
SickJumps( 810, 30000, 1.0, 50.0, 5.0, 10.0, 0.8)

but with "end_multiplier=0.8" it works perfectly now,

Tested with video+audio this time and it does the job, the .avs can be played in real time without issues too btw, also nice to create easily a kind of small slomo effect with deceleration and acceleration at the start/end of the selected scene.

Thank you very much for sharing this tool and for the help, It's something i will use in the future, my way of achieving this same effect was not very complicated but tedious, but those days are over now

Last edited by Yanak; 27th November 2017 at 15:59.
Yanak is offline   Reply With Quote
Old 7th May 2018, 20:41   #7  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,500
@Robert Martens
Did you compile your release in debug instead of release mode? It's asking for MSVCP140D.dll

https://forum.videohelp.com/threads/...l-dependencies
sneaker_ger is offline   Reply With Quote
Old 7th May 2018, 21:59   #8  |  Link
Robert Martens
Registered User
 
Join Date: Feb 2010
Location: New York
Posts: 116
Ouch! I'm a dope. I paid very close attention to the x64 build, but the x86 binary didn't get the same scrutiny, and indeed ended up built in Debug mode. I've updated the plugin by just releasing a new version (avoids having multiple flavors of the 0.1.0 DLLs out there, some Debug, some Release), and I've taken the opportunity to register at Videohelp so I could let that user know what went wrong. My post hasn't been approved yet, I guess since I'm a new user, but I imagine a moderator will be along eventually. Thanks for the heads up!
Robert Martens is offline   Reply With Quote
Reply

Tags
ramp, remap, remapping, speed, time

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 03:22.


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