views:

2911

answers:

4

I'd like to include some simple video editing functionality for the python application I'm writing and googling comes up with:

  1. pymedia
  2. pyglet (using the media module)
  3. gst-python

Requirements:

  1. Small footprint. I'm already using wxpython (just because), which bloats up the final .exe pretty easily so preferably whatever I use to implement this video editing functionality shouldn't add to the bloat significantly.
  2. The library should still be actively maintained -- pyffmpeg seems to be a dead project.
  3. Shouldn't require proprietary licensing, so FMOD is out of the question.
  4. Minimal dependencies
  5. Not a full blown video editor. No need for fancy pants stuff. Just the ability to skip to different parts of a video and either grab a frame or put (multiple) markers for start and end of video sections to lop off bits.
  6. cross platform - should be able to run on Windows, Linux and OS X at the end of the day.

If you've used any of the above video editing libraries listed above or others I have yet to come across in your python application, I'd like to know the pitfalls for each and how they stack up against each other. If you also know of a python binding for avbin, I would like to know where to find it.

Edit 1: gst-python (Gstreamer with python bindings) doesn't seem to be very well documented. It also appears to be tightly coupled with pyGTK, which is also a pretty big toolkit.

+7  A: 

I would recommend that you look again at gst-python! It is not coupled with pyGTK. You can use it completely separately, with no dependencies on either the Python bindings or the C libraries of GTK. I've written several command-line utilities that use gst-python and not GTK.

It's true that the gst-python docs are not so great. However, the documentation for the C API and modules is really very extensive, and the mapping from the C API to the Python API is very straightforward. And there is a very active Gstreamer community and I had good luck finding help on the mailing lists and IRC!

Dan
+4  A: 

gst-python isn't coupled with pygtk at all - it just happens to share a common object model (pygobject) and a way to help generate bindings. But you can easily use gst-python without pygtk - take Flumotion as an example.

Here's a small demo I put together; one with an example of a player with a GTK frontend, and one with a wx frontend.

Thomas Vander Stichele
Please fix the link to the demo.
Cristian Ciupitu
I fixed it for him.
Simucal
+3  A: 

I'm working on a project using pyglet right now and I absolutely love it. Their website is going slow right now, but normally the programming guide on their documentation page is an excellent introduction to the library. Their standard API documentation is also very thorough.

I can't really go into the specifics right now of what our project is, but when you say you need

Not a full blown video editor. No need for fancy pants stuff. Just the ability to skip to different parts of a video and either grab a frame or put (multiple) markers for start and end of video sections to lop off bits.

I can verify that pyglet will make coding this a breeze.

Going through the rest of your list, I can't speak for/against the file size right now, but pyglet is being actively maintained (in fact the devs were quite helpful to me on the bug tracker just two weeks ago), is BSD licensed, depends on nothing (with optional AVBIN support for additional file formats), It works for us on Windows and Linux.

So far the only cross-platform gotcha we have come to is that as far as sound is concerned on Linux, you've got the option of OpenAL which will mix down stereo files to mono and ALSA which will not give you any volume control while a sound is playing. They claim that both of these problems are with upstream and are being worked on.

Ryan
+1  A: 

I am currently in the same prediciment. I have been fortunate to get in touch with the developers of the Ardome Media Library project.

https://code.launchpad.net/ardome-ml

This library is a filter graph based system. It is freely based on the http://www.khronos.org/openml/ I think.

It currently runs on Linux and OSX with pending Windows integration.

smerten