Funscript&Video merger / splitter

This might be a stretch, but it’d be really cool if this program could read the .llc files that Lossless Cut generates: GitHub - mifi/lossless-cut: The swiss army knife of lossless video/audio editing

Thanks once more for this program and your continued improvements to it. If I could ask for one more thing, it would be great if you could queue multiple jobs. I’m using the tool only for splitting funscripts and sometimes I have multiple jobs that can take a while so it would be nice if I could select multiple csv files in the dialog so that all of them are split one after the other.

Thank you for this!

Having an issue with naming the CSV file. The original is KR bj3.csv. Target start time for the split is 458000ms, end 496000ms.

How do I edit the csv file columns? Rename the file?

Sorry if this is a silly question, I’ve tried renaming the file multiple times but it keeps saying “Error reading split csv file: csv needs startms endms and name”.

Hi,

the name should always be the same as the video with a csv extension.

The content of the file from a texteditor like notepad should look like

startms;endms;name;speed
458000;496000;part1;

Or you create a excel file with this 4 rows and 2 columns and save it as csv.


About the other requests: I will look into it, as soon as the weather is less… good.
And thanks for the positive feedback.

That did it! Awesome! Thank you so much!

For anyone interested, I created a step by step guide on how to do merging and splitting using this tool. It has screenshots and stuff that explain the process.

3 Likes

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.

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