Skip to main content

FFVideo is a python extension makes possible to access to decoded frames at two format: PIL.Image or numpy.ndarray.

Project description


In Ubuntu you can install the above using the following commands:

sudo aptitude install python-dev cython libavcodec-dev libavformat-dev libswscale-dev

tar -xf FFVideo-0.0.13.tar.gz
cd FFVideo-0.0.13
python install


sudo aptitude install python-dev cython libavcodec-dev libavformat-dev libswscale-dev python-pip
pip install ffvideo

How to use

Getting thumnails or videostream info

from ffvideo import VideoStream

def print_info(vs):
    print '-' * 20
    print "codec: %s" % vs.codec_name
    print "duration: %.2f" % vs.duration
    print "bit rate: %d" % vs.bitrate
    print "frame size: %dx%d" % (vs.frame_width, vs.frame_height)
    print "frame_mode: %s" % vs.frame_mode

vs = VideoStream('0.flv')

vs = VideoStream('0.flv',
                 frame_size=(128, None), # scale to width 128px
                 frame_mode='L') # convert to grayscale

frame = vs.get_frame_at_sec(2)
print frame.size

# PIL image, required installed PIL

# numpy.ndarray, required installed numpy
print frame.ndarray().shape

Iterating over frame sequence

from ffvideo import VideoStream

for frame in VideoStream('0.flv'):
    print frame.timestamp

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for FFVideo, version 0.0.13
Filename, size File type Python version Upload date Hashes
Filename, size FFVideo-0.0.13.tar.gz (47.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page