Funscript&Video merger / splitter

I’ve split a lot of vids/funscripts and it works awesome! However when I try and merge, in the output folder there is only an output.funscript and no output.mp4. Any ideas why?

Is there an error on the right side of the tool?

But if I would have two guess, there are two reasons in my mind:

If you have something other than mp4 -like webm. Try to convert it first. ffmpeg is not that good with other formats.

You can easily do that with a bat file with this content (converts all webm in the folder, change the path to ffmpeg obviously):
for %%i in (*.webm) do c:\ffmpeg\bin\ffmpeg.exe -i “%%i” “%%~ni.new.mp4”

Another reason might be that you try to merge a video without sound. Then you need to untick the “include audio stream” box or there will be no video.

@burtreynolds thanks ;).

Do you use the newest version of ffmpeg? Maybe that solves it.

But I could imagine that the video only splits in whole frames (and always takes the partial frame), while the funscript is always split in the ms time provided. So the video is always slightly longer and that sums up.
In that case I would have to add a fps setting for splitting the funscript or take a look how long the created video is before merging the funscripts.
I’ll see what I can do ;).

1 Like

Thanks for taking a look at this.

I was not using the latest version of ffmpeg, but I am now and I’m still getting unsatisfactory results.

Today I tried working on a video that I wanted to split into two sections and then merge those two sections into one. It’s a 4k video with a frame rate of 29.97 fps. For part 1, I made my first cut directly on the scripted point and the second cut between two points. The resulting part 1 video was in sync with its script. For part 2, I did the same thing where I made my first cut directly on the scripted point and the second cut between two points. Surprisingly/frustratingly the resulting part 2 video is not in sync with its script. Unsurprisingly, the final merged video does not match its script, but surprisingly it does not lose sync after the cut between part 1 and part 2. It instead loses sync within the first two seconds. The result is similar for all of the FAST, MEDIUM, and SLOW outputs.

Then, using the same video, I did this process all over again making sure that this time all of my cuts were between points. This resulted in both part 1 and part 2 being perfectly in sync with their scripts. Unfortunately when these two parts are merged, the resulting output video loses sync with its script within the first two seconds. The result is similar for all of the FAST, MEDIUM, and SLOW outputs.

I made a bunch of notes about the FAST, MEDIUM, and SLOW outputs for both tests and how they did, and did not, sync up with each other and the original. Eventually it started to make me sound like a crazy person, and I had to toss all that information because it just became noise.

Additionally, there is still a loss in image quality with SLOW resulting in a much softer image than FAST or even MEDIUM.

Ok, I took a few looks.
Seems like ffmpeg is just not that accurate -_-.

I tried a few things. There is a second split button now, that calls a different ffmpeg command that did not have the empty frame issue in my tests.
I also added a checkbox to cut the video at the real frames. So if a frame is every 33ms, a cut at 350ms will be at 333ms instead.
Works a lot better in my tests. Only speed increases are still a bit off.

1 Like

Great! Thanks so much taking a look at it and making the updates. Hopefully I’ll have some time to play around with it next week, and I’ll let you know what kind of results I get.

Any idea if yo7 can embed the funscript into the video file?

Even if you can. For it to be useful, the video/script player would need to support embedded funscripts.
So there is currently no use for it unless one of those supports it and gives instructions on how to embed the script for it to be compatible.

Just curious, is there a way to make it so that when merging videos don’t always end up at 20 fps?

Best regards!

1 Like

Thats actually an easy one ;). Added an option for the “slow” button.

image

1 Like

thank you so much! Been trying to split VR scenes, but they always came out weird. Hopefully this will fix that :smiley:

Does this support multi-axis funscripts?

Not “officially”. But you could split or merge every axis funscript (pitch, roll, etc) serparately with the same video.
You should also be able to cancel the video processing after the first script has done it, because funscripts are generated first.

1 Like

Got a couple of questions for you. Since most VR scenes are 59.94 fps and you can only choose whole numbers for merging would that be an issue? I’ve tried merging a couple and they seem “off”

Also most 8k VR videos I try to split end up having the image going slow but audio in normal speed, would that just be because my current setup can’t handle it or is it just something with the application?

Best regards!

While processing a 4K 60 fps video, I noticed that the bitrate was much lower after conversion than before (7563 kBit/s vs. 20430 kBit/s)

Is anyone getting this error in the runtime window?

Could not load file or assembly 'MediaToolkit, Version=1.1.0.1, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.

I’ve changed the .csv file from ‘,’ to ‘;’ as shown in the examples, moved files in and out of the folder where the executable is, pointed it to different versions of ffmpeg.exe.

I have .net 6 and .net 8, both the core and desktop pieces installed.

I have no idea what file it’s looking for, or if it’s an included library that’s supposed to be in ffmpeg.exe.

I have the full version of ffmpeg, and I’ve tried both the gyan and btbn builds.

I’ve even tried ‘run as administrator’

Poking around, this seems to be an omission in the includes for the application, not ffmpeg.exe

Any suggestions?

The System is unable to load/find the MediaToolkit.dll that is included in the zip.
Maybe you forgot to extract the zip before running the exe or the folder you started the tool from has some weird name?

no, I unpacked the whole zip (rt click and ‘extract here’

But when unzipped it again, the mediatoolkit.dll and three folders showed up.

It runs, now. Thanks for your time!

when trying to keep the same scale, by setting size for scaling video 1920;1080, it fails with an invalid parameter error.

@overkeks Were you able to look into that bitrate issue I mentioned?

yes, ffmpeg does the video magic and I do not specify a framerate, so it uses some default I think.
Adding something like -b:v 2M -b:a 192k might do the trick. I’ll try when I have some time.