Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

An attempt to make GStreamer elements that allow to stabilize shaky video streams

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 python
Octocat-spinner-32 .gitignore
Octocat-spinner-32 COPYING
Octocat-spinner-32 COPYING.LESSER
Octocat-spinner-32 README.rst
README.rst

GstStabilizer

This stuff is still in a rather early stage of development (or should I say "research"), but might already be useful in some use cases.

You should be able to get the latest version like this:

git clone git://github.com/guijemont/GstStabilizer.git

License

This software is distributed under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

A copy of the GNU Lesser General Public License, and of the GNU General Public License (to which it refers) respectively in the files COPYING.LESSER and COPYING.

Dependencies

Usage

For the elements to be recognized, you need to include in GST_PLUGIN_PATH the directory where you checked out GstStabilizer (that is, the directory that contains the python directory and not the python directory itself).

Example pipeline:

gst-launch filesrc location=<my_shaky_video> ! decodebin ! tee name=tee \
  tee. ! ffmpegcolorspace ! opticalflowfinder ! opticalflowrevert name=mux \
  tee. ! ffmpegcolorspace ! mux. \
  mux. ! ffmpegcolorspace ! xvimagesink

Note that depending on the video and the options you give to opticalflowfinder, live stabilisation might not always be doable. If it's too laggy, your probably want to encode and save the stream instead of sending it to a visualisation sink.

You want to have a look at the myriad of options that can be set in opticalflowfinder:

gst-inspect opticalflowfinder

The most important of them is the algorithm, the two currently implemented are:

Lucas-Kanade
The faster one, good for typical video streams where there is little change from one frame to the next.
SURF
Slower, but can handle big changes from one frame to the next. Very useful for time lapses taken from a moving camera (specially developed for a time lapse from a tethered helium balloon, see http://balloonfreaks.mooo.com/).

Limitations

  • Only works if the original stream always points towards the same area of interest, i.e. does not support voluntary camera movements, they are all recognized as "shake" that should be compensated.
  • Slower than what it could actually be

Bugs and patches

Over there: https://github.com/guijemont/GstStabilizer/issues

Something went wrong with that request. Please try again.