My favorites | Sign in
Project Logo
                

PyFFmpeg is a wrapper around FFmpeg's libavcodec and libavformat libraries whose main purpose it to provide access to individual frames of video files of various formats (including mpeg and divx encoded videos).

Download PyFFmpeg

Looking for a new maintainer

Since I'm not longer involved in any project that actively uses PyFFmpeg, I find it hard to devote the time to maintain it, or even to close the open tickets. If you're willing to pick it up, please write me at egooli@gmail.com.

-- gooli

FFmpeg

http://ffmpeg.mplayerhq.hu/ is a tool for encoding, decoding and converting audio and video files. It includes libavcodec, a leading audio/video codec library that can work with most video and audio formats and doesn't depend on anything else, including the video codecs on Windows.

Using FFmpeg and libavcodec you can develop applications that can parse and display video files and be sure they will work on any machine, including Linux and Windows boxes.

PyFFmpeg

The libavcodec and libavformat libraries of the FFmpeg project are quite complex to use, especially from Python. PyFFmpeg provides a simple object oriented interface to those libraries.

PyFFmpeg is a work in progress and currently can only extract individual frames from video files and create PIL image objects from them. While there are several Python libraries that can play video files (like wx.MediaCtrl from the [www.wxpython.org wxPython] library, none can extract frames, and this is the reason PyFFmpeg was created.

If you're looking for a more complete solution, you should take a look at PyMedia. It is has a more complex interface and is based on and old version of ffmpeg, but may well suit your needs.

Example

Here's a simple example that extracts the first frame from a video file and saves it in .png format. You'll need PIL to run it.

import pyffmpeg

stream = pyffmpeg.VideoStream()
stream.open('myvideo.avi')
image = stream.GetFrameNo(0)
image.save('firstframe.png')








Hosted by Google Code