How to use FunscriptToolBox MotionVectors Plugin in OpenFunscripter

Seems to work great for standard riding motions, although whenever the girl grinds on the cock it definitely seems to lose a lot of accuracy since there’s less motion. Not sure if there’s any settings I can adjust to help with that. It’s probably just one of the sections you’ll need to manually script.

Anyway, great work with this! It’s really impressive.

2 Likes

Holy sh-t this is really impressive :scream:
The preparation took only an hour for a 3400*1700 45min video, and I just scripted 10 min of it with much more ease than with MTFG, it’s such a quality of life improvement when it comes to motion tracking since you don’t lose tracking every two minutes and the funscript generation is nearly instantaneous. I still have to dive into manuals tweaks, but so far as other have said it seems like a huge breakthrough in scripting tooling.
Thank you so much for sharing this !

1 Like

Updated the tool/plugin from 1.2.0 to 1.2.2. See the first post for the details. Nothing major, just some small changes.

If you don’t want to always change the height for different files:

1 Download ffmpeg: Releases · BtbN/FFmpeg-Builds (github.com)

2 extract ffmpeg to your ‘FSTB-PrepareVideoForOFS’ directory. Mine is: C:\toolbox\FSTB-PrepareVideoForOFS

3 put these lines in a powershell script:
$env:Path += “;C:\toolbox”
$mp4Files = Get-ChildItem -Path . -Filter *.mp4
foreach ($file in $mp4Files) {
Write-Host — motionvectors.prepare for $file —
$height=“C:\toolbox\FSTB-PrepareVideoForOFS\ffmpeg\bin\ffprobe.exe -v error -select_streams v:0 -show_entries stream=height -of default=noprint_wrappers=1:nokey=1 $file”
FunscriptToolbox.exe motionvectors.prepare --ffmpegfilter=2D --ffmpegfilterHeight=$height $file
}

4 run script if you have the videos in the directory. Basically this is the same as the batch file, it just changes heights automatically.

2 Likes

Oh nice! i’ll give this a try. based on your description it might be better than the motion tracking tool i’m currently using as a base for my scripts.

i have an idea to make this tool more accurate. What if we start to play the whole video, and in the same time start an OBS session, and always zoom to the moving parts?
So basically in the recorded video which would be made with OBS, only the actual moving would be recorded, and later used by the script. Like if there are 3 actors in the scene, and 1 or 2 actors are “working”, the 3rd actor who is not important/not moving, could be cut out by OBS. At the end of a session like this, the whole funscript would be much more accurate. It is just an idea, i have to try it.

hint: my above idea works, but Bandicam is a better tool for that instead of OBS. Screen area crop is better with Bandicam.

Love the program, a interesting alternative to the tracker… works well so far! I had a few questions:

  1. Are there any recommendations as to speed up the “creating a motion vectors optimized video” process for VR videos?
  2. Is there any way to use more GPU vs CPU for these optimization processes?
  3. Is there any difference in speed when using VRLeft vs. VRMosaic?
  4. Also, is there any video compression going on when the optimized video is being created? This process is done twice?
    I am already using a lower quality video to reduce the optimization time (ex: 1080p from 8k). Any advice would be appreciated!

Thanks in advance!

You’re already using the biggest reduction with 1080p instead of 2048, which is 4 times less stuff to encode. VRLeft doesn’t have the 2 smaller views. I thought those views could be useful for doggy position but I guess you could go without them. This would remove another ~33% (i.e. 2h instead of 3h).

The last part .mvs-visual.mp4 is optional. You could skip it by adding --novisual,
and also --keeppframes, in case you change your mind later on (if not, the first .mp4 will be deleted and you’ll have to recreate it to make .mvs-visual.mp4). You won’t see an image if you are using the UI but it’s not a big deal. But I’m not sure it will save you a lot of time if you create an I-frames version of your video anyway, which work a lot better in OFS.

I haven’t used hardware-enable in ffmpeg because I read that it’s not as good as CPU version. I’m not 100% certain if it would support the needed feature (i.e. -bf 0 -g 10000 to get no B-frames at all, and the least amount of I-frames as possible). For this first release, I wanted to make sure to be as safe as possible.

You can try to play around with hardware compression yourself. The “preparation” is, more or less, simply running those commands (I put the VRLeft filter at 1080 in my example):

ffmpeg    -i ".\VIDEONAME.mp4" ^
		  -filter:v crop=in_w/2:in_h:0:0,scale=-1:1080 ^
		  -bf 0 -g 100000 -c:a copy ^
		  ".\VIDEONAME.mvs-p-frames.mp4"
"pathToFunscriptToolBox\MotionVectorsExtractor\MotionVectorsExtractor.exe" ^
          ".\VIDEONAME.mvs-p-frames.mp4" ^
		  ".\VIDEONAME.mvs"
ffmpeg  -flags2 +export_mvs ^
          -i "VIDEONAME.mp4" ^
		  -filter:v codecview=mv=pf+bf+bb ^
		  -g 1 -c:a copy ^
		  "VIDEONAME.mvs-visual.mp4"
1 Like

Would it be possible to be able to specify a timeframe for the reencode instead of reencoding the whole video? That could potentially save a lot of time.

Encoding only part of the video might work but he will have to ‘stitch’ together all his script afterward. Using the audio sync verbs might help but there will still be manual stuff to do.

There is another parameter to the preparation that could be set, something like:
--additionalinputffmpeg "-ss 6:50 -to 12:24"

It should work but I never tried something like that.

Thanks for building this. It has really ramped up my scripting.

1 Like

Updated the tool/plugin to 1.2.3. Fixed a bug in the plugin.

The plugin does seem good after playing with it for a while. Motion tracking is pretty accurate overall and its fast to use.

I had some small issue what i messaged to @Zalunda in DM.
I didn’t notice the actions might stay selected after you have tracked some part, and you can remove the “selected” parts if you start tracking next one.


If you move the last point what you have motion tracked, the box should say empty and you are good to move on to next part.

2 Likes

Updated the tool/plugin to 1.2.4. Small fixes/changes in the plugin. Nothing major.

I also added a FAQ in the Original Post:

  • The original video already contains motion vectors, why do we need to reencode it?
  • How do the virtual actions adjusting work exactly?
1 Like

Demo worked fine was able to test with the video you provided but when i tried on my own video i got this ‘FunscriptToolbox’ is not recognized as an internal or external command,
operable program or batch file.

if i move the funscripttoolbox.exe to the same directory or copy it i get: Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly ‘log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a’ or one of its dependencies. The system cannot find the file specified.
at FunscriptToolbox.Program.Main(String args)
Press any key to continue . . .

moved the script to the root folder now i get this Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly ‘log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a’ or one of its dependencies. The system cannot find the file specified.
at FunscriptToolbox.Program.Main(String args)
Press any key to continue . . … I cant get that part working

Copying/moving the executable around is not a good idea. All the files need to be in the “structure” extracted from the zip file.

image

If not, you’ll get “FileNotFoundException” as you had.

Your problem is probably the path in “–FSTB-PrepareVideoForOFS.1.0.bat” file.
Did you move the FunscriptToolbox folder after you run “–FSTB-Installation.bat”?

This part (green box in image below) should be the folder where you extracted the zip file:
image

Hello once again!
Is there any way to generate multiple motionvectors for more than one video at a time? I haven’t tried runnig multiple instances of the .bat - but I can imagine this would push a lot of load on the CPU. If there was someway to do this I would love to hear any ideas. Loving the program so far! Thanks in advance.