Funscript&Video merger / splitter

Thanks for creating this tool and sharing it with us.

I tried using it for the first time back in August, but had difficulty and frustrations so I took a break. I’ve recently come back to trying to learn to use it again. The first problem that I’m having is that I’ve tried a bunch of different videos, and every time I split the video my output videos get an extra frame added at the beginning. I can actually see the additional frame when I click through frame-by-frame in a media player or OFS. When I merge with the FAST or MEDIUM settings, the additional frame remains in each of the clips that were merged and the script is no longer in sync. When I merge with the SLOW setting, the issue is usually corrected but I always end up with a video that only has 20fps. There’s also a subtle, but noticable, change in the video quality after splitting as well as merging.

Am I doing something wrong, or is there anything that can be done about this? The end result is so close to being perfect.

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.