Funscript out of sync in videos made in Losslesscut?

hello everyone!
I usually cut out the best parts of large (6k-8k) vr videos and then merge the clips into a new smaller video file, using losslesscut or virtualdub/avi demux. Everything works great, the new movies work in all common video players I’ve tested. BUT! when I make funscripts for the merge movies, it’s like the funscript players recognize the old clips in the merge video files. both script player and heresphere vr player.
What happens is that the funscript gets out of sync by a millisecond or so after each “old” clip in the new “merge” video file. If I press pause or rewind a few seconds, the funscript ends up in time again.
Even openfunscripter detects the old cuts, when I rewind it stops for a while at the old cut.
-I have tried opening the video file in shotcut and then exporting/rendering a new video file, then it works with funscript!!!
The problem is that the quality gets worse and it takes days to make a new vr video file…

-Is there any program that can repair, fix or rebuild my video files without rendering?

  • There is nothing “wrong” with my videos that are cut/merged in lossless cut, it’s just the funscript that doesn’t sync correctly…
    Please help!! I’m going crazy soon!!

I think you’re running into keyframe/i-frame issues. Its very hard to precisely cut and join modern compressed files.

When you’re merging files without re-encoding, it MAY have mis-timed keyframes, especially if using files from different videos.

You could try using ffmpeg to join the videos and see if you get a better result. Concatenate – FFmpeg

1 Like

This, and/or the generate timestamps option (i dont have ny ffmpeg reference in front of me) may be the trick.

Hi and thanks!
The files are from the same video…
I guess I have to learn more about ffmpeg :wink:

any other suggestions, other programs?

I did a test last year to try to make lossless cuts and merge. It’s not easy.

Like g90ak said, it’s about the keyframes/I-frame.

From what I saw in my tests using ffmpeg. A lossless cut might produce a file that seems to be cut exactly where you wanted but ffmpeg is cheating a little bit.

Ffmpeg actually made the cut at the previous I-frame and created a stream with negative frame numbers (or something similar). So the resulting stream has a few unwanted frames, that are not played by default.

When you try to merge the cut file with other files, the unwanted frames are brought back from the dead and mess up the timing.

In theory, in my example, it should be possible to make an ‘almost lossless cut’ by recompressing frames 14 to 16 in a file and then merging that small file with a lossless cut from frame 17 to the end. The same thing might be needed at the end of the cut too because B-frames are created using the next ‘I or P frame’. I’ve never been able to make it work with ffmpeg. I don’t remember the exact problem, this is something I’ve put on hold for now.

1 Like

Also, if it’s from the same video. You might try this:

  1. Cut/Merge like you did (note: you’ll get a few unwanted frames)
  2. Use FunscriptToolbox to create a synchronized script for the recut scene. It uses the audio track for the synchronization, so it should work fine with the unwanted frames.
    "C:\Tools\FunscriptToolbox\FunscriptToolbox.exe" as.cfs -i original-file.funscript -o new-recut-scene.mp4

Note: FunscriptToolbox might not work right now. It seems that the URL that it’s using to download ffmpeg.exe is not responding anymore. I’ll make a new version in a few days.

Ill plead ignorance here - if we use Losslesscut’s “Keyframe Cut Mode” and the seek-to-keyframe buttons would that bypass this issue? Ive always kept that option in place since I assumed there would be timing issues without.

you should try using premeir pro. for files that large usually 4 k or above i will use its proxy feature to encode a smaller sized version of the file to use as a preview while editing the original. you can right click and use detect split points to have the program cut where there are cuts already letting you edit easier. it does require you to encode but thats a given

I agree - Either make the files standalone (1 file per cut), or use a video editing program to make your compilations.

Yes, the compilations will be lossy, but if you’re starting with good quality videos and making good decisions around the final encode, you’ll be in a good place.

1 Like

Many THANKS for all the reply and suggestions!! :smiling_face_with_three_hearts:
Now I have more thing to try!!
(I have always use Losslesscut’s “Keyframe Cut Mode” and use the seek-to-nerest-keyframe buttons, but the problem is still there)
Ones again Thanks!!
I`ll let you know if I succeed

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.