How to convert funscripts for wrong fps

If a scripted video becomes unavailable and another source has the wrong frames per second (e.g. 30 vs 29.97 or 60 vs 59.94), the script will get out of sync more and more over the runtime.

If the original video can’t be retrieved, give this a shot:
You can rescale all timestamps in a funscript easily using https://beta.funscript.io/

  1. Click Modify script in the left menu.
  2. Drag and Drop the source funscript to the indicated area on the site (as far as I understand, it does not get uploaded, all processing happens in JavaScript code in your browser locally).
  3. Click the Add your first modifier button.
  4. Select Modifier Type: Custom
  5. It will show you some sample code that would add 100ms to all timestamps, shifting the script. Not exactly what we want, so replace the sample code by 1 of these 2:
    a) To convert from 29.97 to 30 fps (or from 59.94 to 60 fps):
actions => {
        //divide all timestamps by 1.001 to speed up the script
        //for conversion 29.97 to 30 fps or 59.94 to 60 fps
        return actions.map(action => ({...action, at: action.at / 1.001}));
    }
  1. b) To convert from 30 to 29.97 fps (or from 60 to 59.94 fps)
actions => {
        //multiply all timestamps by 1.001 to slow down the script
        //for conversion 30 to 29.97 fps or 60 to 59.94 fps
        return actions.map(action => ({...action, at: action.at * 1.001}));
    }
  1. Press Confirm
  2. Finally, you can verify the script changes visually and then press Save modified script. It will not overwrite the original, but instead save a new script with the suffix _MODIFIED to your browser’s download folder.

If the changed fps is the only difference in the new video source, that should fix it. If other edits (beyond mere shifts - use the Offset modifier for those) were done, you’re out of luck.

5 Likes