Motion Tracking Funscript Generator v0.5.x

OK Thanks, i will implement an Watchdog Timer in my ffmpegstream class to improve the handling of such problems in further program versions.

1 Like

Have you tried to re-encode the video and checked if the same issue occur on the re-encoded video? You can use ffmpeg to reduce frames per second and resolution or use an application like Handbrake to re-encode.

Thanks, Iā€™ve done that and it works to finish off the video. I posted more to notify the creator of an error case that it is unhandled.

1 Like

@mchyxnaaiorxfwrivv
Thanks for making this tool, may I know what sort of algorithm is used after the tracking that needs a long time to process?

Example for an 4 min Video with AMD Ryzen 3900X CPU:

  1. Quadratic interpolation of tracking signal: (3 seconds)
  2. Calculate difference between boxes for x, y, roll, distance and map them to 0 - 100% for each frame: (15 seconds)
  3. scale all differences to user input of max and min (x < 1 second)
  4. Get local min and max points in selected metric e.g. y direction: (x < 1 second)
  5. Get additional change points by comparing second deviation with rolling standard deviation: (x < 1 second)
  6. Export data (x < 1 second)

The biggest time requirement is probably in this function. The numpy implementation of masked array is very slow. Theoretically, I could use the standard mean calculation for the case with only one tracker for men and women, which should speed up this case significantly. And I think most people use only one tracker anyway. Maybe Iā€™ll have time to take a closer look in the next few days.

Can you explain how 2+ trackers works? Iā€™ve used them a bit when having trouble with only one tracker, but Iā€™m not really sure how it should be used.

I doubt Iā€™m reading your code correctly, but it looks as though it tracks the center between the tracked points?

Could you check if !trackers > 1 and then run stdmean for that situation so it maintains the functionality of multiple trackers, but offers a fast path for the easy case?

can we have this script?!?!?!

I am not familiar with Python or numpy so I couldnā€™t be of help (and I havenā€™t figured out why mean is required).
So the time consuming task is for filtering 2-tracker case when 1 tracker loss tracking causing invalid data?

Does Quadratic interpolation help with ā€œmissingā€ top or bottom points when they appear between sampling?

sorry for asking so many programming questions.

??? The script is out for months

1 Like

Can you explain how 2+ trackers works? Iā€™ve used them a bit when having trouble with only one tracker, but Iā€™m not really sure how it should be used.

@internetpornwho Tracking with several trackers currently only has the advantage that an averaging of the calculated scores per tracker results in a somewhat more accurate signal. The idea was/is that you select several trackers and if then one tracker no longer finds his feature you can still continue tracking until all trackers of one type are lost. But this function is currently not implemented and the current code is only a partial implementation so that this can be made possible later. (The first mentioned improvement is already working in the current release)

Could you check if !trackers > 1 and then run stdmean for that situation so it maintains the functionality of multiple trackers, but offers a fast path for the easy case?

This is how i will probably implement it (i also mentioned it briefly in my previous post)

So the time consuming task is for filtering 2-tracker case when 1 tracker loss tracking causing invalid data?

@trasssh Yes and no. Yes the code can handle invalid tacking data when one tracker lost the feature. But as mentioned above, this function is currently not fully implemented.

Does Quadratic interpolation help with ā€œmissingā€ top or bottom points when they appear between sampling?

Yes

1 Like

Thatā€™s a tip Iā€™m totally going to have to steal from you - with a modification to account for the fact that humans have to interact with the result!

I set the options and hit Refresh only 3-4 times before something 100% usable (random AND readable AND memorable) came up.

Anyway, this thread floated up to the top of my view I wanted to say thanks for making this - the first time I tried it, I had poor results because I hadnā€™t noticed that the tracking box you were to draw was supposed to be VERY SMALL and not ā€œthis is the whole area to parse - the whole womanā€

Now that Iā€™ve seen some examples with very small tracking areas, life is good. Double thanks!

1 Like

Curious if anyone is willing to take the time to walk me through getting this installed? Would love to be able to utilize this but Iā€™ve gotten lost on how to do it lol

Where are you having an issue - have you tried following the video tutorial/walkthrough, or the step by step instructions with pictures listed in the OP? At what point in that process are you running into an issue.

ā€œIf you are new to scripting or have never used OFS before, i recommend to check out Huskyā€™s video series How to script in OpenFunScripter - video tutorial . In Part 3 it explains the installation and usage of this extension. In addition, a step by step installation instruction with pictures is available on GitHub.ā€

Iā€™m having issues with the latest version (1.6) that I hadnā€™t seen in the previous version I was running (1.4). Sometimes when it finishes a section, it shows the min/max, I then hit space to confirm and thenā€¦ no points are populated? This can happen multiple times. Sometimes if I let it sit for a minute on that screen and then confirm it will work, but other timesā€¦ just, nothing happens. I have made a few videos already with this new script so I donā€™t think the Settings.tmpfile is the issue as well I have 64gb of RAM so I doubt thatā€™s the issue.

I went back to the 1.4 version and this issue is still present, but seems less prominent?

Thank you for the feedback. I have also noticed the problem but have not yet been able to find a source for it. I have only noticed that, if I generate less log messages that it occurs less often.

In my case one python thread did not terminate (maybe a kind of deadlock) and therefore the data was not transferred to OFS. I have only seen this problem on windows. On Linux the problem does not seem to occur (at least not for me).

To help you you could do the following:

  • If the tracking is finished (after the min max selection) and no data is inserted in ofs look in windows taskmanager if the funscript-editor.exe is running, if yes kill it ā†’ are the dates inserted now?

  • What installation method do you use, the OFS extension (Installation Option 1) or via the special function in OFS (Install Option 2)?

  • Can you look into your log file when no points are transferred to OFS and check if you have the line Save result to xxx/xxx.csv.

I am using windows

Iā€™ll work on the first point:: After testing - No, when the points are not inserted the funscript-editor.exe is not still running

  • I installed using Install Option 2

  • Save result to xxx/xxx.csv is present in the log when this occurs

More testing - still anecdotal:

  • A scene failed 2 times in a row, almost immediately pressing spacebar when it finished
  • Third time - I waited until the process for ffmpeg finished then immediately pressed spacebar - the output was saved in OFS - but waiting a long time doesnā€™t mean it will succeed either
  • Another scene failed - this time ffmpeg finished before the final prompt for the limit was displayed - no output in OFS
  • Repeat of the same scene and this time a similar thing happened, but the output was displayedā€¦

Man this is super difficult to try find a consistent behavior.

@internetpornwho Thanks for the help in finding the source of the problem. I create a new release v0.1.7. with some small adjustment to address the problem. it would be helpful if you could try this release and give feedback if it got better, worse or unchanged.

2 Likes

First off - I love that you use the previous settings for video type/tracking etc.

Iā€™m definitely still having issues with it.Iā€™ve only tried it with one video so far, which has been giving me tons of trouble, but it seems to be a little better? It doesnā€™t really seem to matter whether I wait or not until the ffmpeg process finishes or I just hit space right away with the prompt. It seems about 30-50% it posts to OFS, which is seems better than I was getting (probably 20%).

Iā€™m determining whether ffmpeg is finished by waiting until the process goes to 0% and then removes itself under the funscript editor process in task manager.

Will continue trying for a bit, but wonā€™t be able to give feedback again for a week.

@internetpornwho I had some time and could do some tests in my windows vm. I found that the problem with installation method 2 via the special function has another problem in addition to the one I know about. Here the data is simply not reliably transferred to OFS (tested with version 1.4.2). We would have to look at what has changed in the OFS code. You can debug this by adding the line print("add", actions[1][i], actions[2][i]) to your lua script at this position (above or below). Now you can see that all results will be passed to OFS but sometimes get lost.

For now you should switch to installation method 1 where I have not encountered this problem so far

1 Like

Would that it were so simple.

After running the installer ā†’ enabling the extension and hitting Start MTFG
Error:
[string ā€œā€¦ā€]:45: attempt to call a nil value (field ā€˜CreateProcessā€™)

Hitting Open Config:
Error:
[string ā€œā€¦ā€]:136: attempt to call a nil value (field ā€˜CreateProcessā€™)

Hitting Show Log:
Error:
[string ā€œā€¦ā€]:142: attempt to call a nil value (field ā€˜CreateProcessā€™)

Iā€™ve removed all traces of the Funscript Generator from my computer then tried running the installer again and the results are the same.

Could this have anything to do with having multiple drives on my computer?

I should probably be private messaging you this, but I figured itā€™s better to do it here so any troubleshooting/resolution can be found for anyone else having issues.

1 Like