Introducing Movit, free library for GPU-side video processing
While OpenCL and CUDA are all the rage even in free software today, a certain element was missing — a free library for GPU-based video effects. But not anymore.
Steinar H. Gunderson has just announced Movit, a free C++ library for video effects processing that completely relies on GPU. His reasoning?
- It's 2012, so people want to edit HD video.
- It's 2012, so everybody has a GPU.
- It's 2012, so everybody has a working C++ compiler.
Actually, it's very nearly 2013 — all the more reasons for such a project. The targeted end-user software would be Kdenlive (via MLT), albeit, as Steinar states, the API has some impendance mismatch with MLT currently, plus he doesn't intend to fit Movit into MLT's filter chain.
Movit does all the processing on a GPU with GLSL fragment shaders. On a GT9800 with Nouveau drivers I was able to get 10.9 fps (92.1 ms/frame) for a 2971×1671px large image. Is it good or bad? Well, it seems quite fast. In fact, here is a video of that quick test:
The library works in a linear color space with floating point precision, can do basic color space conversions (e.g. sRGB to XYZ and back) and mix sources.
It also has an initial set of useful filters: lift/gamma/gain (color grading), blur, diffusion, glow, mirror, scale (bilinear and Lanczos), sharpening (both by unsharp mask and by Wiener filters), saturation and desaturation, vignetting, and white balance.
Currently the library is licensed under GPL v2+ which might negatively impact its adoption in the future.
The demo application in the video above is part of the library. It tries to use an image that isn't part of the bundle due to licensing, so you can just place and rename any JPEG you have around, or tweak the source code.
The project doesn't yet have a website, only a public Git repository.
$ git clone http://git.sesse.net/movit
You will need both Eigen3 and GoogleTest to build the library and the demo application.
Meanwhile in a galaxy not far away...
Dan Dennedy has just released a new version of the MLT framework featuring FFmpeg 1.0 and libAV master compatibility, and a new audiolevel (measurement) filter. Now that it's released, Dan is about to start reviewing a GLSL-based processing framework that was contributed by Christophe Thommeret earlier this year.
Dan doesn't have plans to use Movit as independent library in MLT. As of today, he's rather interested in certain bits of Movit. It's up to developers of other projects (Novacut, PiTiVi), if they will want to use Movit or wait till GLSL lands to upstream MLT. Or come up with something of their own maybe?
Jonathan Thomas hasn't yet stated any plans regarding release of his own library for video processing, and so far GPU-side processing hasn't been mentioned (but threaded design was).