Motion Tracking Funscript Generator v0.5.x

Thank you, I was able to test it out and it works perfectly! Thanks again for all your help :smiley:

could this somehow be used for a live control of the handy? is the output of the motion tracking realtime? i was thinking about tinkering around with the newest handy firmware where you can control the handy via bluetooth. if now the motion tracking output is realtime it could be used for controling the handy directly if im asuming the function right. you could open the porn site of your choice and have an motion tracking overlay and maybe use it on specific scenes directly.

that would be so nice for games

is the output of the motion tracking realtime?

yes and no. My Implementation use an post processing after the tracking has completed. Only the raw tracking data is realtime. But post processing would be possible with a different algorithm in an streaming mode.

I think the main problem is that the next position to be moved to is transmitted to the device. Thus, you need the next position before you see it in the video. Otherwise you would always have a slight offset between video and device.

Hey all. This is probably a noob question, but I’ve been looking for literally hours. I’m trying to use the motion tracking but can’t seem to get it to work. I watched the video tutorial, and read the instructions. In the Open Funscript Integration zip, there is no funscript_generator_windows.lua. I think this is what I need to change the special characters in the folder path. Even in the instructions, it’s listed as an asset but I’m just not seeing it anywhere. I’m using windows 10 and the latest version (1.4.4) of OFS. Am I missing something completely obvious? Somebody please help.

I watched the video tutorial, and read the instructions. In the Open Funscript Integration zip, there is no funscript_generator_windows.lua.

I removed the video tutorial for the installation, because it was outdated. The newer versions do not use the script funscript_generator_windows.lua anymore! Please follow the latest Install instruction. I recommend to use the Installation Windows (Easy) method from the instruction if possible. If you have problems with the instructions, please give me the number in the instructions at which point you are stuck.

To get the latest manual ensure you have select the main branch as shown in the screenshot below.

Thanks for the quick response! The Installation Windows (Easy) is the one I was following. I did everything until the end of step 6. When I click “Start MTFG” it gives me the Funscript Generator Error. Video File Not Specified. (Make sure there are no special symbols like squared brackets in the file path → Rename your video file and store them in a path with no special characters). I have a video opened so I believe I need to rename the file path. Thanks for your patience.

I had the same problem. i shut down OFS and reopened it and it took a minute but then it started working.

1 Like

That did the trick! I feel like an idiot now. Thanks!

1 Like

It’s working now. I took the advice from another user and the program just needed to be closed and reopened. Thanks! Can’t wait to go crazy with this.

This is pretty great. The multi axis tracking is confusing though. I was testing it out on a 3DVR video and the y axis tracking was inaccurate when using the multi axis mode, but really accurate when using only the up-down mode. It seems like the local min-max is inverted because after tracking, I see the left frame showing a high position, but requesting the lowest value, and the right frame showing a low position, but requesting a high value. It’s also confusing the set up the trackers because it’s asking for left/top and right/bottom feature #x, but it doesn’t say which person, the numbers just increment up so I get confused when I’m trying to use more than one tracker.

has anyone been experiencing trouble with an increase in “tracking time insufficient” I doesn’t matter what setting I use it fails every time

Yes. It seems to be most problematic with rotation. It works great with up-down y axis tracking. I have not had much if any luck tracking other axes. Setting up the trackers is confusing.

im using a 2D video that I have used this program on before but idk what happened. Nothing can be detected

Just read…

With new version of OpenFunScripter every extensions are broken.

I think You have downloaded Motion Tracking Funscript for new API. Just download latest version of OFS (2.0) and then install MTF v0.4.x.

I’ll check what I have downloaded in a bit. I updated both of them and started to have the problems.

@Midevil If you still have problems, please describe your problem in more detail.

im using a 2D video that I have used this program on before but idk what happened. Nothing can be detected

What do you mean by Nothing can be detected? Do the tracking stops tracking right after you start?

has anyone been experiencing trouble with an increase in “tracking time insufficient” I doesn’t matter what setting I use it fails every time

Normally you don’t need to adjust this value, please leave it at the default value and describe your problem in more detail so I can help you.

It seems like the local min-max is inverted because after tracking, I see the left frame showing a high position, but requesting the lowest value, and the right frame showing a low position, but requesting a high value.

@StyleMavin cannot reproduce it right now. If it happens to you again, it would be helpful to take a screenshot of it and send it to me via private message. So that I can analyze where the tracker points are located…

the numbers just increment up so I get confused when I’m trying to use more than one tracker.

I currently recommend using only one tracker (per person). Since a higher number only brings a small quality advantage but significantly slows down the overall process.

so i’ve used the program to help with scripting animated and irl videos before. Was a little wonky at times but was reliable when it worked. recently I was revamping a old script I made and I remember using the tool to help with scripting for some of the BJ scenes but I am running into a problem in which it will just end in a tracking time insufficient error.


Screenshot (341)

the log shows as this:

log output

2022-07-17 14:03:29,836 - funscript_editor.api - INFO - Python Funscript Generator 0.4.0
2022-07-17 14:03:29,836 - funscript_editor.api - INFO - Startup Path: G:\yeah\OpenFunscripter
2022-07-17 14:03:29,836 - funscript_editor.api - INFO - Args: video_file=G:\yeah\sscripts\Mia Khalifa Me Getting extra dick Behind the scenes! HD.mp4, start_time=874719.07276422, end_time=875023.01025391, output_file=C:\Users\redacted\AppData\Roaming\OFS\OFS2_data\extensions\Funscript Generator Windows/funscript_actions.json
2022-07-17 14:03:29,967 - funscript_editor.ui.funscript_generator_window - INFO - Set End Time to Frame Number 26251
2022-07-17 14:03:29,967 - funscript_editor.ui.funscript_generator_window - INFO - Hyperparameter:{‘min_frames’: 90, ‘user_reaction_time_in_milliseconds’: 1000, ‘signal’: {‘local_max_min_filter_len’: 1, ‘avg_sec_for_local_min_max_extraction’: 2.0, ‘distance_minimization_threshold’: 16.0, ‘high_second_derivative_points_threshold’: 1.2, ‘direction_change_filter_len’: 3, ‘additional_points_merge_time_threshold_in_ms’: 60, ‘additional_points_merge_distance_threshold’: 8.0, ‘min_evenly_intermediate_interframes’: 2, ‘additional_points_repetitions’: 2}, ‘scene_detector’: {‘min_scene_len_in_seconds’: 3, ‘scene_content_detector_threshold’: 30.0, ‘scene_threshold_detector_threshold’: 12}, ‘tracker’: {‘tracking_init_phase_in_sec’: 6, ‘tracking_plausibility_factor_x’: 4.0, ‘tracking_plausibility_factor_y’: 2.5}}
2022-07-17 14:03:29,967 - funscript_editor.ui.funscript_generator_window - INFO - Config:{‘use_zoom’: False, ‘zoom_factor’: 4.0, ‘max_playback_fps’: 0, ‘preview_scaling’: 0.6, ‘tracker’: ‘CSRT’, ‘notification_sound’: ‘off’, ‘scene_detector’: ‘THRESHOLD’, ‘raw_output’: False, ‘dark_theme’: False, ‘tracking_plausibility_check’: False, ‘ffmpeg_timeout_in_seconds’: 15}
2022-07-17 14:03:32,865 - funscript_editor.ui.funscript_generator_window - INFO - settings: {‘videoType’: ‘2D Video with Filters’, ‘trackingMetrics’: ‘x’, ‘trackingMethod’: ‘Unsupervised one moving person’, ‘numberOfTracker’: ‘1’, ‘points’: ‘Local Min Max’, ‘additionalPoints’: ‘None’, ‘processingSpeed’: ‘0’, ‘topPointOffset’: 10, ‘bottomPointOffset’: -10}
2022-07-17 14:03:33,247 - funscript_editor.ui.opencvui - INFO - Show ROI Menu
2022-07-17 14:03:35,364 - funscript_editor.data.ffmpegstream - INFO - FFmpeg Stream Watchdog started with 15 sec timeout
2022-07-17 14:03:35,364 - funscript_editor.data.ffmpegstream - INFO - Open FFmpeg Stream
2022-07-17 14:03:40,848 - funscript_editor.ui.opencvui - INFO - User Input: (498, 316, 76, 74, 536, 353)
2022-07-17 14:03:40,849 - funscript_editor.algorithms.videotracker - INFO - Start CSRT Tracker
2022-07-17 14:03:40,849 - funscript_editor.algorithms.scenedetect - INFO - Use Threshold Detector
2022-07-17 14:03:41,125 - funscript_editor.algorithms.funscriptgenerator - INFO - Raw tracking data: 7 Tracking points for 0 seconds of the video
2022-07-17 14:03:41,125 - funscript_editor.algorithms.funscriptgenerator - INFO - Tracking stop at existing action point
2022-07-17 14:03:41,125 - funscript_editor.algorithms.funscriptgenerator - INFO - Interpolate tracking boxes
2022-07-17 14:03:41,125 - funscript_editor.algorithms.funscriptgenerator - INFO - Use quadratic interpolation
2022-07-17 14:03:41,127 - funscript_editor.algorithms.funscriptgenerator - INFO - Calculate score for 1 Tracker(s)
2022-07-17 14:03:41,127 - funscript_editor.algorithms.funscriptgenerator - INFO - Merge Scores
2022-07-17 14:03:41,132 - funscript_editor.algorithms.funscriptgenerator - INFO - x: Scale Score to 0 - 100
2022-07-17 14:03:41,133 - funscript_editor.algorithms.funscriptgenerator - INFO - y: Scale Score to 0 - 100
2022-07-17 14:03:41,133 - funscript_editor.algorithms.funscriptgenerator - INFO - distance: Scale Score to 0 - 100
2022-07-17 14:03:41,133 - funscript_editor.algorithms.funscriptgenerator - INFO - roll: Get absolute Score
2022-07-17 14:03:41,142 - funscript_editor.ui.funscript_generator_window - INFO - Save result to C:\Users\redacted\AppData\Roaming\OFS\OFS2_data\extensions\Funscript Generator Windows\funscript_actions.json
2022-07-17 14:03:41,142 - funscript_editor.ui.funscript_generator_window - ERROR - Tracking stop at existing action point → Tracking time insufficient (7/90 Frames)
2022-07-17 14:03:43,502 - funscript_editor.ui.funscript_generator_window - INFO - EXIT with Workaround

I tried opening another project in which I used the previous version of the tool to script and the same thing is occuring


Screenshot (337)

log for the animated video

log output

2022-07-17 14:08:28,971 - funscript_editor.api - INFO - Python Funscript Generator 0.4.0
2022-07-17 14:08:28,972 - funscript_editor.api - INFO - Startup Path: G:\yeah\OpenFunscripter
2022-07-17 14:08:28,972 - funscript_editor.api - INFO - Args: video_file=G:\yeah\sscripts(Commission) Duty Commenced - HD.mp4, start_time=4000.0000099967, end_time=4833.0001831055, output_file=C:\Users\redacted\AppData\Roaming\OFS\OFS2_data\extensions\Funscript Generator Windows/funscript_actions.json
2022-07-17 14:08:29,067 - funscript_editor.ui.funscript_generator_window - INFO - Set End Time to Frame Number 116
2022-07-17 14:08:29,067 - funscript_editor.ui.funscript_generator_window - INFO - Hyperparameter:{‘min_frames’: 90, ‘user_reaction_time_in_milliseconds’: 1000, ‘signal’: {‘local_max_min_filter_len’: 1, ‘avg_sec_for_local_min_max_extraction’: 2.0, ‘distance_minimization_threshold’: 16.0, ‘high_second_derivative_points_threshold’: 1.2, ‘direction_change_filter_len’: 3, ‘additional_points_merge_time_threshold_in_ms’: 60, ‘additional_points_merge_distance_threshold’: 8.0, ‘min_evenly_intermediate_interframes’: 2, ‘additional_points_repetitions’: 2}, ‘scene_detector’: {‘min_scene_len_in_seconds’: 3, ‘scene_content_detector_threshold’: 30.0, ‘scene_threshold_detector_threshold’: 12}, ‘tracker’: {‘tracking_init_phase_in_sec’: 6, ‘tracking_plausibility_factor_x’: 4.0, ‘tracking_plausibility_factor_y’: 2.5}}
2022-07-17 14:08:29,067 - funscript_editor.ui.funscript_generator_window - INFO - Config:{‘use_zoom’: False, ‘zoom_factor’: 4.0, ‘max_playback_fps’: 0, ‘preview_scaling’: 0.6, ‘tracker’: ‘CSRT’, ‘notification_sound’: ‘off’, ‘scene_detector’: ‘THRESHOLD’, ‘raw_output’: False, ‘dark_theme’: False, ‘tracking_plausibility_check’: False, ‘ffmpeg_timeout_in_seconds’: 15}
2022-07-17 14:08:34,245 - funscript_editor.ui.funscript_generator_window - INFO - settings: {‘videoType’: ‘2D Video with Filters’, ‘trackingMetrics’: ‘y’, ‘trackingMethod’: ‘Unsupervised one moving person’, ‘numberOfTracker’: ‘1’, ‘points’: ‘Local Min Max’, ‘additionalPoints’: ‘None’, ‘processingSpeed’: ‘0’, ‘topPointOffset’: 10, ‘bottomPointOffset’: -10}
2022-07-17 14:08:34,475 - funscript_editor.ui.opencvui - INFO - Show ROI Menu
2022-07-17 14:08:35,551 - funscript_editor.data.ffmpegstream - INFO - FFmpeg Stream Watchdog started with 15 sec timeout
2022-07-17 14:08:35,551 - funscript_editor.data.ffmpegstream - INFO - Open FFmpeg Stream
2022-07-17 14:08:37,098 - funscript_editor.ui.opencvui - INFO - User Input: (433, 637, 164, 128, 515, 701)
2022-07-17 14:08:37,098 - funscript_editor.algorithms.videotracker - INFO - Start CSRT Tracker
2022-07-17 14:08:37,098 - funscript_editor.algorithms.scenedetect - INFO - Use Threshold Detector
2022-07-17 14:08:37,990 - funscript_editor.algorithms.funscriptgenerator - INFO - Raw tracking data: 18 Tracking points for 0 seconds of the video
2022-07-17 14:08:37,990 - funscript_editor.algorithms.funscriptgenerator - INFO - Tracking stop at existing action point
2022-07-17 14:08:37,990 - funscript_editor.algorithms.funscriptgenerator - INFO - Interpolate tracking boxes
2022-07-17 14:08:37,990 - funscript_editor.algorithms.funscriptgenerator - INFO - Use quadratic interpolation
2022-07-17 14:08:37,993 - funscript_editor.algorithms.funscriptgenerator - INFO - Calculate score for 1 Tracker(s)
2022-07-17 14:08:37,993 - funscript_editor.algorithms.funscriptgenerator - INFO - Merge Scores
2022-07-17 14:08:37,998 - funscript_editor.algorithms.funscriptgenerator - INFO - x: Scale Score to 0 - 100
2022-07-17 14:08:37,998 - funscript_editor.algorithms.funscriptgenerator - INFO - y: Scale Score to 0 - 100
2022-07-17 14:08:37,998 - funscript_editor.algorithms.funscriptgenerator - INFO - distance: Scale Score to 0 - 100
2022-07-17 14:08:37,998 - funscript_editor.algorithms.funscriptgenerator - INFO - roll: Get absolute Score
2022-07-17 14:08:38,006 - funscript_editor.ui.funscript_generator_window - INFO - Save result to C:\Users\redacted\AppData\Roaming\OFS\OFS2_data\extensions\Funscript Generator Windows\funscript_actions.json
2022-07-17 14:08:38,006 - funscript_editor.ui.funscript_generator_window - ERROR - Tracking stop at existing action point → Tracking time insufficient (18/90 Frames)
2022-07-17 14:08:40,599 - funscript_editor.ui.funscript_generator_window - INFO - EXIT with Workaround

I’m really at a loss here

Thank you for the detailed report now i know exactly what your problem is. The program is programmed to stop at the next existing point in OFS (starting from the current position where you start the tracking). Since it usually makes no sense to track already existing actions in the script again. The question would be: is the detention wrong? Do you not have any points in OFS closely behind the selected starting point?

If not, then there is definitely a bug in the script. To find it i would need the following information:

  • How many scipte/axes are you using in OFS?

I addition i will also implement a function in the next release so you can disable this behavior by a checkbox in OFS.

1 Like