Skip to content
This repository has been archived by the owner on Jul 8, 2023. It is now read-only.

Image stabilization guide (alpha)

Elvin edited this page Aug 21, 2022 · 3 revisions

Warning: This is outdated information. Find the Gyroflow software here: https://github.com/gyroflow/gyroflow and the docs here: https://docs.gyroflow.xyz/

Note that this guide is mainly intended for alpha/beta testers as opposed to "production" use. The stabilization code is still work in progress and the following process will most likely change drastically as the program improves. Native blackbox stabilization support is being worked on, but files modified using BlackboxToGPMF can be used when combined with the proper lens calibration preset. The plan for the next public alpha will be to streamline the process and add a video guide for alpha testers. If you can't get this to work at the moment, I recommend following the progress through Discord/Facebook and waiting a couple of weeks for the next update instead of contacting me for help.

Prerequisites

  • Python installation with required dependencies
  • GoPro clip with embedded gyro data or clip generated by BlackboxToGPMF
  • Gyroflow files (Note: don't use outdated executable)
  • Camera calibration preset. Bundled presets of similar cameras like Hero_7_2.7K_60_4by3_wide_V2.json can be used in a pinch, but it's best to generate a new one as described here for now. Hopefully presets for a bunch of common cameras will be bundled later if enough people help with it.

General stabilization steps

  1. Navigate to the gyroflow folder and run the utility using python gyroflow.py.
  2. Open the barebone stabilization tool by clicking on the button.
  3. Open the video and preset by clicking on the respective buttons.
  4. Set smoothness to something between 80% and 99% (will definitely be revamped later)
  5. Output crop should be less than or equal to the the file resolution. Usually going from 4:3 to 16:9 works fine when using wide angle fisheye lenses. Leave FOV scale at 1.5.
  6. Watch the video in a separate player and find two timestamps near beginning and end of video for syncing, where there is some motion, but nothing too crazy. Usually twitches, slight vibrations or turns are good spots. Write the timestamps in auto sync timestamp 1 and 2.
  7. Something between 60 and 120 frames to analyze seems to work. Less frames are required for syncing vibrations. More frames are required to match slower movements.
  8. Select the right gyro orientation. Use hero5 if using BlackboxToGPMF.
  9. Click compute sync. The window may seem frozen, but status messages are printed in the terminal. After analyzing the first batch of frames, a debug plot will appear showing the gyro/video error as a function of gyro delay. Ideally this should have a single clear downward spike where video frames and gyro data matches (might require zooming in). Close this plot. Another similar plot will appear after a few moments that is zoomed in. After closing the first set of plots, the second batch of frames are analyzed and displayed in the same way.
  10. After both sets of frames are analyzed, the gyro data is displayed with the frame x,y,z rotations in three separate plots. Zoom in to make sure gyro and video actually matches. If the data don't match or is scaled incorrectly, then it could indicate a bad slice of frames to analyze, a bad camera tilt value, or a bad/incorrect lens preset.
  11. Close the plots and return to the stabilization utility. Delay for sync 1/2 should be filled in automatically. These can be tweaked manually if needed. Clicking the Sync correction button will apply changes to sync delay and smoothness, followed by the same plots displayed in step 10. Tests have shown that the current sync algorithm may give a delay that is one frame off for some reason. This is being worked on, but try increasing/decreasing the sync delay(s) by 1/fps if slight jitter/vibration appears in output.
  12. Input a valid start/stop range for export, and select/deselect the split screen option. Then click export to define a save location and begin export. The video is displayed while exporting. The settings can be tweaked after exporting the first file if needed, so it can be useful to export a short clip to check if the settings and sync are correct.

If you can get it to work please share the results in the Discord or Facebook group. Otherwise it's best to wait for the next update as previously written.