Beats2Fun (Funscript tools / PMV Generator)

My somewhat selfish feature requests now that it sort of works:

  • Allow it to use short clips (shorter than the song length)
  • Allow it to use other file formats (.mp3 for audio, .webm for video, etc…)

But looks great so far. Thanks for the hard work @Nootna8

1 Like

so close but no cigar it also only detected 3 out of the 4 videos in that folder too

Input: F:\yeah\ingrid music\S3rl - Hentai (DJ Edit) [sickworldmusic].sm - Video dir: F:\yeah\ingrid - Output dir: C:\Program Files (x86)\Beats2Fun

Checking input .

Checking input . .
Input - Song: F:\yeah\ingrid music/S3rl - Hentai (DJ Edit) [sickworldmusic].ogg - Beatcount: 470, - Output: C:\Program Files (x86)\Beats2Fun\S3rl - Hentai (DJ Edit) [sickworldmusic]-PMV.mp4 v

Getting and processing beats .

Getting and processing beats . .
Getting and processing beats v

Found 3 videos

Video clip analasys: 33% | 1/3 [00:00<00:01, 1.94it/s]
Video clip analasys: 67% | 2/3 [00:00<00:00, 2.90it/s]
Video clip analasys:100% | 3/3 [00:00<00:00, 3.29it/s]
Video clip analasys:100% | 3/3 [00:00<00:00, 3.01it/s]

Clip assignment:100% | 185/185 [00:00<00:00, 186525.54it/s]

Splitting videos: 5% | 1/21 [00:19<06:24, 19.22s/it]
Splitting videos: 10% | 2/21 [00:19<02:33, 8.09s/it]
Splitting videos: 14% | 3/21 [00:20<01:28, 4.92s/it]
Splitting videos: 19% | 4/21 [00:23<01:06, 3.91s/it]
Splitting videos: 29% | 6/21 [00:29<00:51, 3.43s/it]
Splitting videos: 33% | 7/21 [00:33<00:53, 3.84s/it]
Splitting videos: 38% | 8/21 [00:35<00:43, 3.33s/it]
Splitting videos: 43% | 9/21 [00:44<00:56, 4.68s/it]
Splitting videos: 48% | 10/21 [00:44<00:37, 3.40s/it]
Splitting videos: 52% | 11/21 [00:44<00:25, 2.60s/it]
Splitting videos: 57% | 12/21 [00:46<00:20, 2.29s/it]
Splitting videos: 67% | 14/21 [00:50<00:14, 2.05s/it]
Splitting videos: 71% | 15/21 [00:54<00:15, 2.52s/it]
Splitting videos: 76% | 16/21 [00:55<00:10, 2.17s/it]
Splitting videos: 81% | 17/21 [00:56<00:08, 2.06s/it]
Splitting videos: 86% | 18/21 [00:58<00:05, 1.96s/it]
Splitting videos: 90% | 19/21 [01:00<00:03, 1.98s/it]
Splitting videos: 95% | 20/21 [01:04<00:02, 2.43s/it]
Splitting videos:100% | 21/21 [01:05<00:00, 2.11s/it]
Splitting videos:100% | 21/21 [01:05<00:00, 3.12s/it]

Merging clips together: 0% | 0/203 [00:00<?, ?it/s]
Merging clips together: 1% | 3/203 [00:00<00:44, 4.48it/s]
Merging clips together: 3% | 7/203 [00:01<00:26, 7.52it/s]
Merging clips together: 5% | 11/203 [00:01<00:23, 8.25it/s]
Merging clips together: 7% | 14/203 [00:02<00:25, 7.49it/s]
Merging clips together: 8% | 17/203 [00:03<00:37, 4.94it/s]
Merging clips together: 10% | 21/203 [00:03<00:31, 5.79it/s]
Merging clips together: 12% | 24/203 [00:04<00:30, 5.81it/s]
Merging clips together: 13% | 26/203 [00:04<00:33, 5.29it/s]
Merging clips together: 14% | 28/203 [00:04<00:32, 5.44it/s]
Merging clips together: 15% | 31/203 [00:05<00:26, 6.61it/s]
Merging clips together: 17% | 34/203 [00:05<00:26, 6.28it/s]
Merging clips together: 19% | 38/203 [00:06<00:31, 5.19it/s]
Merging clips together: 20% | 41/203 [00:07<00:29, 5.46it/s]
Merging clips together: 21% | 42/203 [00:07<00:35, 4.54it/s]
Merging clips together: 23% | 47/203 [00:08<00:26, 5.85it/s]
Merging clips together: 25% | 50/203 [00:08<00:26, 5.79it/s]
Merging clips together: 27% | 54/203 [00:09<00:23, 6.28it/s]
Merging clips together: 29% | 58/203 [00:09<00:21, 6.85it/s]
Merging clips together: 30% | 61/203 [00:10<00:21, 6.72it/s]
Merging clips together: 32% | 65/203 [00:11<00:23, 6.00it/s]
Merging clips together: 33% | 67/203 [00:11<00:20, 6.54it/s]
Merging clips together: 34% | 70/203 [00:11<00:21, 6.14it/s]
Merging clips together: 36% | 73/203 [00:12<00:22, 5.85it/s]
Merging clips together: 37% | 76/203 [00:13<00:22, 5.71it/s]
Merging clips together: 39% | 79/203 [00:13<00:19, 6.42it/s]
Merging clips together: 40% | 82/203 [00:13<00:20, 5.98it/s]
Merging clips together: 42% | 85/203 [00:14<00:18, 6.33it/s]
Merging clips together: 44% | 89/203 [00:14<00:17, 6.42it/s]
Merging clips together: 45% | 92/203 [00:15<00:18, 5.95it/s]
Merging clips together: 47% | 95/203 [00:16<00:18, 5.76it/s]
Merging clips together: 48% | 97/203 [00:16<00:19, 5.48it/s]
Merging clips together: 50% | 101/203 [00:17<00:19, 5.13it/s]
Merging clips together: 52% | 105/203 [00:17<00:16, 5.83it/s]
Merging clips together: 54% | 110/203 [00:18<00:10, 8.60it/s]
Merging clips together: 56% | 113/203 [00:18<00:11, 8.06it/s]
Merging clips together: 58% | 117/203 [00:18<00:10, 8.40it/s]
Merging clips together: 59% | 119/203 [00:19<00:12, 6.91it/s]
Merging clips together: 61% | 124/203 [00:20<00:13, 5.95it/s]
Merging clips together: 64% | 130/203 [00:20<00:08, 8.30it/s]
Merging clips together: 66% | 133/203 [00:21<00:07, 8.89it/s]
Merging clips together: 67% | 136/203 [00:21<00:08, 7.79it/s]
Merging clips together: 68% | 139/203 [00:22<00:11, 5.71it/s]
Merging clips together: 70% | 142/203 [00:22<00:08, 7.16it/s]
Merging clips together: 71% | 144/203 [00:23<00:09, 6.33it/s]
Merging clips together: 72% | 147/203 [00:23<00:09, 6.19it/s]
Merging clips together: 74% | 150/203 [00:24<00:08, 6.30it/s]
Merging clips together: 76% | 154/203 [00:24<00:07, 6.54it/s]
Merging clips together: 77% | 157/203 [00:25<00:06, 6.58it/s]
Merging clips together: 79% | 160/203 [00:25<00:06, 6.24it/s]
Merging clips together: 80% | 163/203 [00:26<00:06, 5.98it/s]
Merging clips together: 82% | 166/203 [00:26<00:06, 6.12it/s]
Merging clips together: 83% | 168/203 [00:27<00:06, 5.59it/s]
Merging clips together: 84% | 170/203 [00:27<00:06, 5.12it/s]
Merging clips together: 85% | 173/203 [00:28<00:05, 5.25it/s]
Merging clips together: 87% | 177/203 [00:28<00:04, 5.52it/s]
Merging clips together: 89% | 181/203 [00:29<00:03, 6.33it/s]
Merging clips together: 90% | 183/203 [00:29<00:03, 5.57it/s]
Merging clips together: 91% | 185/203 [00:30<00:03, 5.48it/s]
Merging clips together: 93% | 188/203 [00:30<00:02, 5.29it/s]
Merging clips together: 95% | 192/203 [00:31<00:01, 6.35it/s]
Merging clips together: 96% | 195/203 [00:32<00:01, 4.84it/s]
Merging clips together: 98% | 198/203 [00:32<00:00, 5.03it/s]
Merging clips together: 99% | 200/203 [00:33<00:00, 4.99it/s]
Merging clips together:100% | 203/203 [00:33<00:00, 6.12it/s]

Overlaying beat sounds: 12% | 55/469 [00:00<00:00, 538.29it/s]
Overlaying beat sounds: 23% | 109/469 [00:00<00:01, 290.40it/s]
Overlaying beat sounds: 31% | 145/469 [00:00<00:01, 239.95it/s]
Overlaying beat sounds: 37% | 173/469 [00:00<00:01, 206.15it/s]
Overlaying beat sounds: 42% | 196/469 [00:00<00:01, 181.69it/s]
Overlaying beat sounds: 46% | 216/469 [00:01<00:01, 165.10it/s]
Overlaying beat sounds: 50% | 234/469 [00:01<00:01, 144.63it/s]
Overlaying beat sounds: 53% | 249/469 [00:01<00:01, 126.37it/s]
Overlaying beat sounds: 56% | 262/469 [00:01<00:01, 117.52it/s]
Overlaying beat sounds: 58% | 274/469 [00:01<00:01, 108.51it/s]
Overlaying beat sounds: 61% | 285/469 [00:01<00:02, 84.95it/s]
Overlaying beat sounds: 63% | 294/469 [00:02<00:02, 81.46it/s]
Overlaying beat sounds: 65% | 303/469 [00:02<00:02, 81.44it/s]
Overlaying beat sounds: 67% | 312/469 [00:02<00:01, 80.53it/s]
Overlaying beat sounds: 68% | 321/469 [00:02<00:01, 79.83it/s]
Overlaying beat sounds: 70% | 330/469 [00:02<00:01, 78.73it/s]
Overlaying beat sounds: 72% | 338/469 [00:02<00:01, 78.13it/s]
Overlaying beat sounds: 74% | 346/469 [00:02<00:01, 77.67it/s]
Overlaying beat sounds: 75% | 354/469 [00:02<00:01, 72.34it/s]
Overlaying beat sounds: 77% | 362/469 [00:02<00:01, 72.61it/s]
Overlaying beat sounds: 79% | 370/469 [00:03<00:01, 72.72it/s]
Overlaying beat sounds: 81% | 378/469 [00:03<00:01, 72.80it/s]
Overlaying beat sounds: 82% | 386/469 [00:03<00:01, 66.74it/s]
Overlaying beat sounds: 84% | 393/469 [00:03<00:01, 56.38it/s]
Overlaying beat sounds: 85% | 400/469 [00:03<00:01, 58.21it/s]
Overlaying beat sounds: 87% | 407/469 [00:03<00:01, 60.51it/s]
Overlaying beat sounds: 88% | 414/469 [00:03<00:00, 57.67it/s]
Overlaying beat sounds: 90% | 421/469 [00:03<00:00, 59.35it/s]
Overlaying beat sounds: 91% | 428/469 [00:04<00:00, 61.62it/s]
Overlaying beat sounds: 93% | 435/469 [00:04<00:00, 63.43it/s]
Overlaying beat sounds: 94% | 442/469 [00:04<00:00, 64.33it/s]
Overlaying beat sounds: 96% | 449/469 [00:04<00:00, 64.98it/s]
Overlaying beat sounds: 97% | 456/469 [00:04<00:00, 64.73it/s]
Overlaying beat sounds: 99% | 463/469 [00:04<00:00, 64.38it/s]
Overlaying beat sounds:100% | 469/469 [00:04<00:00, 100.19it/s]
Exception during ffmpeg: ffmpeg -hide_banner -y -i “C:\Users\redacted\AppData\Local\Temp\tmp41w_rn2r\mbtxi4uw.mp4” -i “C:\Users\redcacted\AppData\Local\Temp\tmp41w_rn2r\w5tgcnuk.ogg” -map 0:v -map 1:a -c:v copy -c:a copy “C:\Program Files (x86)\Beats2Fun\S3rl - Hentai (DJ Edit) [sickworldmusic]-PMV.mp4”, Errorcode: 1
Traceback (most recent call last):
File “Beats2Fun.py”, line 181, in
File “gooey\python_bindings\gooey_decorator.py”, line 134, in
File “Beats2Fun.py”, line 174, in main
File “Beats2Fun.py”, line 104, in make_pmv
File “videoutil.py”, line 503, in video_merge_audio
File “videoutil.py”, line 88, in ffmpeg_run
File “videoutil.py”, line 78, in ffmpeg_run
Exception: Invalid return code
[21892] Failed to execute script ‘Beats2Fun’ due to unhandled exception!

Merging video and audio: 0% | 0/203 [00:00<?, ?it/s]

Looks a beatbar error. Should work if you turn that off for now.

I’ll look into updates later this week. Good to see you’re actually starting to get results haha

1 Like

and it worked!!!
after changing the clip distance to 50 I think it came out pretty good.

This is what I got. Once I get the time I’ll play with it a little more. Is there anything you want us to try to do with the program in particular so that we can give you a gauge on where the program stands?

1 Like

Been trying a few different things and I hit this new error:

Traceback (most recent call last):
File “Beats2Fun.py”, line 181, in
File “gooey\python_bindings\gooey_decorator.py”, line 134, in
File “Beats2Fun.py”, line 174, in main
File “Beats2Fun.py”, line 83, in make_pmv
File “videoutil.py”, line 314, in clips_generate_batched
File “videoutil.py”, line 310, in clips_generate_batched
File “concurrent\futures_base.py”, line 438, in result
File “concurrent\futures_base.py”, line 390, in __get_result
File “concurrent\futures\thread.py”, line 58, in run
File “videoutil.py”, line 350, in clips_generate_batched_thread
ValueError: invalid literal for int() with base 10: b’’
[50484] Failed to execute script ‘Beats2Fun’ due to unhandled exception!

Doesn’t seem to be any of the previous issues, not sure on this one.

I think it’s just REALLY picky about codecs.

@Nootna8 would it be possible to add a step at the beginning that checks each clip to see if it’s supported and exclude it if it’s not?

Some good ideas. Made a list under GitHub issues: Issues · Nootna8/Beats2Fun · GitHub

Please add to it if you have any other ideas that might be nice for other users. Also id you get any other errors please add it there as well!

actually have a question on the usage of sm and osu music files. are they used so that the program can better create funscipts off the beats that are coupled with those files? Just curious.

Yes, it converts the notes to movements

So what are you thinking of doing for integrating mp3s. Will the program detect a certain hz to translate as a beat?

Traceback (most recent call last):
File “Beats2Fun.py”, line 181, in
File “gooey\python_bindings\gooey_decorator.py”, line 134, in
File “Beats2Fun.py”, line 174, in main
File “Beats2Fun.py”, line 49, in make_pmv
File “colorama\ansitowin32.py”, line 41, in write
File “colorama\ansitowin32.py”, line 162, in write
File “colorama\ansitowin32.py”, line 190, in write_and_convert
File “colorama\ansitowin32.py”, line 195, in write_plain_text
File “encodings\cp1252.py”, line 19, in encode
UnicodeEncodeError: ‘charmap’ codec can’t encode characters in position 91-93: character maps to
[15064] Failed to execute script ‘Beats2Fun’ due to unhandled exception!

tried a generated sm file and it seems to no longer work

also tried longer music and it seems to not be able to handle it I’ve tried 4-9 minute songs for sm and osu files and it cant read it

There are methods like onset detection and tempo detection that can be used. A bit like audiosourf does

Idk if you’ve seen this but this program uses audio to create finscripts. granted it’s not the best, but if your looking to integrate mp3s this might help as inspiration. Tool for automatically generate funscript from sound

There are already tools that automatically generate charts from songs. The same tools/tricks could be hooked into Beats2Fun to make that work :o. You could already run these manually, then provide the generated chart to Beats2Fun.

https://monket.net/dancing-monkeys/

1 Like

Tried a rather longer music track and got this

Merging clips together:100% | 3646/3650 [16:28<00:01, 3.43it/s]Exception during ffmpeg: ffmpeg -hide_banner -y -f concat -i “C:\Users\redacted\AppData\Local\Temp\tmpzm10kbc_\gz2spcht.txt” -i “C:\Users\redacted\Desktop\autostepper\80s Workout Hits Session for Fitness And Workout 135 Bpm - 32 Count (128 kbps).mp3_dir/80s Workout Hits Session for Fitness And Workout 135 Bpm - 32 Count (128 kbps).mp3” “F:\yeah\80s Workout Hits Session for Fitness And Workout 135 Bpm - 32 Count (128 kbps)-PMV.mp4”, Errorcode: 1
Traceback (most recent call last):
File “Beats2Fun.py”, line 181, in
File “gooey\python_bindings\gooey_decorator.py”, line 134, in
File “Beats2Fun.py”, line 174, in main
File “Beats2Fun.py”, line 106, in make_pmv
File “videoutil.py”, line 379, in clips_merge
File “videoutil.py”, line 88, in ffmpeg_run
File “videoutil.py”, line 78, in ffmpeg_run
Exception: Error while decoding stream #1:0: Invalid data found when processing input

[30104] Failed to execute script ‘Beats2Fun’ due to unhandled exception!

Merging clips together:100% | 3646/3650 [16:28<00:01, 3.69it/s]

Working on an update with a bunch of fixes/improvements. Should pop up somewhere next week

1 Like

I used Beats2Fun for like 2 days and it’s really cool but I encountered some bugs/problems and have some ideas for features that I would like to recommend(keep in mind that I used only GUI Beats2Fun 0.3 version and that I used it for like 2 days with limited time for testing):

Problem 1: After using Beats2Fun (mostly after error occurs) program starts to run slower, whole pc freezes etc… and it starts working normal after PC restart so most likely programs piles up junk data etc… (idk if it’s fixable and it’s not anything program breaking just wanted to point it out, it only clears after restarting PC not program or clearing temp folder)

Problem 2: Sometimes error occurs with mp4 files and FFMPEG randomly and video won’t process and it’s weird because I use x amount of clips and I use clip A it works normally I edit it a bit remove few clips and when I put new clips error occurs with clip A, same clip that worked normally for last PMV but for new one it doesn’t and it’s annoying, I checked if clip is damage and it’s not. It’s nothing really program breaking but yea it can be annoying sometimes

Problem 3: I don’t know why this problem occurs(didn’t really test it too much though) but sometimes when I make PMV randomly 60% of transitions freeze for like half a second and it looks really bad, it didn’t happend when I first started using Beats2Fun (yesterday), I am not sure if restarting PC or reinstalling will fix it (I can’t restart it rn because I have some other things that I am doing on PC).

Suggestion 1:It would be cool if it’s possible to make custom Beatmap UI default ui is sometimes really hard to see in certain videos and it can be really annoying

Suggestion 2: it would be cool if it’s possible to add custom sound for beats and to choose volume because for certain songs it’s just really hard to hear because of volume and some songs have really similar drums

Suggestion 3: it would be cool if it’s possible to choose intro/Last video because it’s really big part fo whole PMV and it’s as much as I can see randomly chosen which isn’t bad but a bit more customisation would make software 10 times better in my opinion

Traceback (most recent call last):
  File "Beats2Fun.py", line 181, in <module>
  File "gooey\python_bindings\gooey_decorator.py", line 128, in inner2
  File "Beats2Fun.py", line 170, in main
  File "gooey\python_bindings\gooey_parser.py", line 125, in parse_args
  File "gooey\python_bindings\gooey_decorator.py", line 123, in run_gooey
  File "gooey\gui\application.py", line 21, in run
  File "gooey\gui\application.py", line 27, in build_app
  File "gooey\gui\application.py", line 40, in _build_app
  File "gooey\gui\containers\application.py", line 48, in __init__
  File "gooey\gui\containers\application.py", line 215, in layoutComponent
wx._core.wxAssertionError: C++ assertion "strcmp(setlocale(0, 0), "C") == 0" failed at ..\..\src\common\intl.cpp(1694) in wxLocale::GetInfo(): You probably called setlocale() directly instead of using wxLocale and now there is a mismatch between C/C++ and Windows locale.
Things are going to break, please only change locale by creating wxLocale objects to avoid this!
[8312] Failed to execute script 'Beats2Fun' due to unhandled exception!

[process exited with code 1 (0x00000001)]

i have that error when launch the app, how to solve it?

windows 11, Python 3.10.4

If you want to use your systems python use the manual installation.
The setup has it’s own python included which can clash with your systems python installation