Set of tools for transferring optical flow from one media to another.
This tool extracts optical flow as a dense velocity field from a video input (file or stream) and applies it to an image, a video file or stream, for creative purposes. Multiple techniques can be used, various parameters can be tuned to precisely craft visual effects directly from raw raster data. Here is how it looks (click to view in full resolution):
Flow Source | Bitmap Source | Result |
---|---|---|
Have a look at:
You'll need a working installation of Python 3. You'll also need FFmpeg binaries, available in PATH
, the ffmpeg -version
command should work.
The process should be straightforward.
- Download the latest release
- Install it with
pip
:pip install ~/Downloads/transflow-1.0.0.tar.gz
- Test installation:
python -m transflow --help
If you want to access the code.
- Clone or download this repository:
git clone https://github.com/ychalier/transflow.git cd transflow
- Install requirements:
pip install -r requirements.txt
- Test installation:
python transflow.py --help
The simplest process consists in taking the motion from a video file and applying it to an image:
transflow flow.mp4 -b image.jpg -o output.mp4
The alias transflow
represents either python -m transflow
or python transflow.py
, depending on the chosen installation method. For more details, see USAGE.md.
This repository also contains two other versions of this program:
- in the cpp folder, a C++ version using OpenCV to transfer the flow from one webcam to another,
- in the www folder, a WebGL version that emulates the effect in a web browser; a version is hosted on chalier.fr/transflow.
There is also another module, viewflow, for visualizing and inspecting optical flow in a video player setting.
Contributions are welcomed. Do not hesitate to submit a pull request with your changes! Submit bug reports and feature suggestions in the issue tracker.
This project is licensed under the GPL-3.0 license.