You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gyroflow is an application that can stabilize your video by using motion data from a gyroscope and optionally an accelerometer. Modern cameras record that data internally (GoPro, Sony, Insta360 etc), and this application stabilizes the captured footage precisely by using them. It can also use gyro data from an external source (eg. from Betaflight blackbox).
Real time preview, params adjustments and all calculations
GPU processing and rendering
Fully multi-threaded
Rolling shutter correction
Supports already stabilized GoPro videos (captured with Hypersmooth enabled) (Hero 8 and up)
Supports and renders 10-bit videos (up to 16-bit 4:4:4:4 for regular codecs and 32-bit float for OpenEXR - works directly on YUV data to keep maximum quality)
Customizable lens correction strength
Render queue
Visual chart with gyro data (can display gyro, accel, magnetometer and quaternions)
Visual display of smoothed quaternions
Real time offset adjustments
Two optical flow methods
Two offsets calculation methods
Modern responsive user interface with Dark and Light theme
Adaptive zoom (dynamic cropping)
Support for image sequences (PNG and OpenEXR)
Based on telemetry-parser - supports all gyro sources out of the box
Multiple gyro integration methods for orientation determination
Multiple video orientation smoothing algorithms, including horizon levelling and per-axis smoothness adjustment.
Cross-platform - currently works on Windows/Linux/Mac, with Android and iOS apps coming
Multiple UI languages
Supports variable and high frame rate videos, all calculations are done on timestamps
x264, x265, ProRes, DNxHD, PNG and OpenEXR outputs, with x264 and x265 fully GPU accelerated (ProRes also accelerated on Apple M1 Pro/Max/Ultra)
Automatic lens calibration process
Fully zero-copy GPU preview rendering (working but experimental)
Core engine is a separate library without external dependencies (no Qt, no ffmpeg, no OpenCV), and can be used to create OpenFX and Adobe plugins (on the TODO list)
Automatic updates of lens profile database
Built-in lens profiles for GoPro HERO 6, 8, 9 and 10 in all shooting modes
Supported gyro sources
GoPro (HERO 5 and later)
Sony (a1, a7c, a7r IV, a7 IV, a7s III, a9 II, FX3, FX6, FX9, RX0 II, RX100 VII, ZV1, ZV-E10)
For cameras which do have built-in gyro, please contact us and we will implement support for that camera. Refer to the documentation for information about the gyro logging process.
For cameras which don't have built-in gyro, please consider using Betaflight FC or check out our flowshutter project.
Gyroflow is written in Rust, with UI written in QML. It uses Qt, ffmpeg, OpenCV and mdk-sdk external dependencies for the main program, but the core library is written in pure Rust without any external dependencies.
OpenCV usage is kept to a minimum, used only for lens calibration and optical flow (src/core/calibration/mod.rs and src/core/synchronization/opencv.rs). Core algorithms and undistortion don't use OpenCV.
GPU stuff supports DirectX, OpenGL, Metal and Vulkan thanks to Qt RHI and wgpu.
For GPU processing we use OpenCL or wgpu, with highly parallelized CPU implementation as a fallback.
Code structure
Entire GUI is in the src/ui directory
src/controller.rs is a bridge between UI and core, it takes all commands from QML and calls functions in core
src/core contains the whole gyroflow engine and doesn't depend on Qt or ffmpeg, and OpenCV is optional
src/rendering contains all FFmpeg related code for rendering final video and processing for synchronization
src/core/gpu contains GPU implementations of the undistortion
src/qt_gpu contains zero-copy GPU undistortion path, using Qt RHI and GLSL compute shader, but this method is experimental and buggy for now
src/gyroflow.rs is the main entry point
mod.rs or lib.rs in each directory act as a main entry of the module (directory name is the module name and mod.rs is kind of an entry point)
Dev environment
Visual Studio Code with rust-analyzer extension.
For working with QML I recommend to use Qt Creator and load all QML files there, as it has auto-complete and syntax highlighting.
The project also supports UI live reload, it's a super quick way of working with the UI. Just change live_reload = true in gyroflow.rs and it should work right away. Now every time you change any QML file, the app should reload it immediately.
Please make sure to check the English language pack option when installing the C++ build tools from Visual Studio Installer
Clone the repo: git clone https://github.com/gyroflow/gyroflow.git
Install dependencies to the ext directory: cd gyroflow/ext
Qt 6.3.0 or higher: pip3 install -U pip & pip3 install aqtinstall then aqt install-qt windows desktop 6.3.0 win64_msvc2019_64 -m qtshadertools or use the official installer
FFmpeg 5.0: download ffmpeg 5.0 lite and unzip it to ext/ffmpeg-5.0-windows-desktop-vs2022-gpl-lite
Install Xcode command line tools: xcode-select --install
Clone the repo: git clone https://github.com/gyroflow/gyroflow.git
Install dependencies: cd gyroflow/ext && ./install-deps-mac.sh
For building on Apple M1, change ffmpeg-x64_64 -> ffmpeg-arm64 and x64-osx-release -> arm64-osx in __env-macos.sh
Setup the environment in terminal: ./__env-macos.sh - I do this in VS Code built-in terminal
For some reason DYLD_FALLBACK_LIBRARY_PATH may be overwritten so export it again in terminal: export DYLD_FALLBACK_LIBRARY_PATH="$(xcode-select --print-path)/Toolchains/XcodeDefault.xctoolchain/usr/lib/" (if you have build errors, try the other one from __env-macos.sh)
Compile and run: cargo run --release
If it fails to run, do: ./_deployment/deploy-macos.sh once
Add a Rust target: rustup target add aarch64-linux-android
Update Cargo.toml to comment out [[[bin]] section and uncomment [lib] section
Patch C:\Users\you\.cargo\registry\src\github.com-1ecc6299db9ec823\opencv-0.61.3\build.rs: Change if cfg!(target_env = "msvc") to if std::env::var("CARGO_CFG_TARGET_ENV").unwrap() == "msvc"
Update paths in _deployment/build-android.ps1
Run .\_deployment\build-android.ps1 in Powershell
Profiling on Windows
Install and run Visual Studio Community Edition
Compile and run GyroFlow with the profile profile: cargo run --profile profile
In Visual Studio, go to Debug -> Performance Profiler...
Under Target, open Change Target and select Running Process..., select the running gyroflow.exe process
License
Distributed under the GPLv3 License. See LICENSE for more information.
Authors
AdrianEddy - Author of the Rust implementation (code in this repository), author of the UI, GPU processing, rolling shutter correction and advanced rendering features
Elvin Chen - Author of the first version in Python, laid the groundwork to make all this possible
Notable contributors
Maik Menz - Contributed to all areas of Gyroflow with fixes and improvements
Aphobius - Author of the velocity dampened smoothing algorithm
https://github.com/gyroflow/gyroflow#readme
Video stabilization using gyroscope data
Homepage • Download • Documentation • Discord • Report bug • Request feature
About the project
Gyroflow is an application that can stabilize your video by using motion data from a gyroscope and optionally an accelerometer. Modern cameras record that data internally (GoPro, Sony, Insta360 etc), and this application stabilizes the captured footage precisely by using them. It can also use gyro data from an external source (eg. from Betaflight blackbox).
Trailer / results video
Features
Supported gyro sources
Sensor Logger
,G-Field Recorder
,Gyro
Sensor Logger
,Sensor Record
Info for cameras not on the list
Minimum system requirements:
Settings
->Apps
->Optional features
->Add a feature
-> enableMedia Feature Pack
.tar.gz
package (recommended): Debian 10+, Ubuntu 18.10+, CentOS 8.2+, openSUSE 15.3+. Other distros require glibc 2.28+ (ldd --version
to check).AppImage
should work everywheresudo apt install libva2 libvdpau1 libasound2 libxkbcommon0 libpulse0 libc++-dev vdpau-va-driver libvulkan1
nvidia-opencl-icd nvidia-vdpau-driver nvidia-egl-icd nvidia-vulkan-icd libnvcuvid1 libnvidia-encode1
intel-media-va-driver i965-va-driver beignet-opencl-icd intel-opencl-icd
mesa-vdpau-drivers mesa-va-drivers mesa-opencl-icd libegl-mesa0 mesa-vulkan-drivers
Help and support
For general support and discussion, you can find the developers and other users on the Gyroflow Discord server.
For companies or people wishing to get in touch with the team privately for collaborative purposes: devteam@gyroflow.xyz.
Roadmap
See the open issues for a list of proposed features and known issues.
There's also a ton of TODO comments throughout the code.
Video editor plugins
Gyroflow OpenFX plugin is available here.
Adobe After Effects and Davinci Resolve plugins are planned, but not ready yet
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributors are greatly appreciated.
Translations
Currently Gyroflow is available in:
Help us translate Gyroflow to your language! We use crowdin to manage translations and you can contribute there: https://crowdin.com/project/gyroflow
I want to contribute but I don't know Rust or QML
Development
Used languages and technologies
Gyroflow is written in Rust, with UI written in QML. It uses Qt, ffmpeg, OpenCV and mdk-sdk external dependencies for the main program, but the core library is written in pure Rust without any external dependencies.
OpenCV usage is kept to a minimum, used only for lens calibration and optical flow (
src/core/calibration/mod.rs
andsrc/core/synchronization/opencv.rs
). Core algorithms and undistortion don't use OpenCV.GPU stuff supports DirectX, OpenGL, Metal and Vulkan thanks to Qt RHI and wgpu.
For GPU processing we use OpenCL or wgpu, with highly parallelized CPU implementation as a fallback.
Code structure
src/ui
directorysrc/controller.rs
is a bridge between UI and core, it takes all commands from QML and calls functions in coresrc/core
contains the whole gyroflow engine and doesn't depend on Qt or ffmpeg, and OpenCV is optionalsrc/rendering
contains all FFmpeg related code for rendering final video and processing for synchronizationsrc/core/gpu
contains GPU implementations of the undistortionsrc/qt_gpu
contains zero-copy GPU undistortion path, using Qt RHI and GLSL compute shader, but this method is experimental and buggy for nowsrc/gyroflow.rs
is the main entry pointmod.rs
orlib.rs
in each directory act as a main entry of the module (directory name is the module name andmod.rs
is kind of an entry point)Dev environment
Visual Studio Code
withrust-analyzer
extension.For working with QML I recommend to use Qt Creator and load all QML files there, as it has auto-complete and syntax highlighting.
The project also supports UI live reload, it's a super quick way of working with the UI. Just change
live_reload = true
ingyroflow.rs
and it should work right away. Now every time you change any QML file, the app should reload it immediately.Building on Windows
git clone https://github.com/gyroflow/gyroflow.git
ext
directory:cd gyroflow/ext
Qt 6.3.0
or higher:pip3 install -U pip & pip3 install aqtinstall
thenaqt install-qt windows desktop 6.3.0 win64_msvc2019_64 -m qtshadertools
or use the official installerFFmpeg 5.0
: download ffmpeg 5.0 lite and unzip it toext/ffmpeg-5.0-windows-desktop-vs2022-gpl-lite
git clone --depth 1 https://github.com/Microsoft/vcpkg.git & .\vcpkg\bootstrap-vcpkg.bat -disableMetrics
.\vcpkg\vcpkg install "opencv[core]:x64-windows-release"
.\vcpkg\vcpkg install "opencl:x64-windows-release"
7z
in PATH../__env.ps1
- I do this in VS Code built-in terminalset-executionpolicy remotesigned
in powershell with admincargo run --release
Building on MacOS
xcode-select --install
git clone https://github.com/gyroflow/gyroflow.git
cd gyroflow/ext && ./install-deps-mac.sh
ffmpeg-x64_64
->ffmpeg-arm64
andx64-osx-release
->arm64-osx
in__env-macos.sh
./__env-macos.sh
- I do this in VS Code built-in terminalDYLD_FALLBACK_LIBRARY_PATH
may be overwritten so export it again in terminal:export DYLD_FALLBACK_LIBRARY_PATH="$(xcode-select --print-path)/Toolchains/XcodeDefault.xctoolchain/usr/lib/"
(if you have build errors, try the other one from __env-macos.sh)cargo run --release
./_deployment/deploy-macos.sh
onceBuilding on Linux
git clone https://github.com/gyroflow/gyroflow.git
cd gyroflow/ext && ./install-deps-linux.sh
(Debian based apt)./__env-linux.sh
- I do this in VS Code built-in terminalcargo run --release
Building for Android
aqt install-qt windows android 6.3.0 android_arm64_v8a
andaqt install-qt windows desktop 6.3.0 win64_mingw
cargo-apk
:cargo install --git https://github.com/rust-windowing/android-ndk-rs.git cargo-apk
rustup target add aarch64-linux-android
Cargo.toml
to comment out[[[bin]]
section and uncomment[lib]
sectionC:\Users\you\.cargo\registry\src\github.com-1ecc6299db9ec823\opencv-0.61.3\build.rs
: Changeif cfg!(target_env = "msvc")
toif std::env::var("CARGO_CFG_TARGET_ENV").unwrap() == "msvc"
_deployment/build-android.ps1
.\_deployment\build-android.ps1
in PowershellProfiling on Windows
Visual Studio Community Edition
profile
profile:cargo run --profile profile
Debug -> Performance Profiler...
Target
, openChange Target
and selectRunning Process...
, select the runninggyroflow.exe
processLicense
Distributed under the GPLv3 License. See LICENSE for more information.
Authors
Notable contributors
Acknowledgements
The text was updated successfully, but these errors were encountered: