Skip to main content

Bindings for FFmpegSource

Project description

Example usage

If you don’t need to keep the index, create a video source right away:

>>> import ffms
>>> source_file = "test/x264.mkv"
>>> vsource = ffms.VideoSource(source_file)

Or you can create an indexer:

>>> indexer = ffms.Indexer(source_file)
>>> indexer.format_name
>>> indexer.track_info_list
[TrackInfo(type=0, codec_name='h264')]

Then create the index for the video source:

>>> index = indexer.do_indexing(-1)
>>> track_number = index.get_first_indexed_track_of_type(ffms.FFMS_TYPE_VIDEO)
>>> vsource = ffms.VideoSource(source_file, track_number, index)

Extract information from the video source:

>>> vsource.track.keyframes
[0, 5]
>>> vsource.track.timecodes
[0.0, 1000.0, 2000.0, 3000.0, 4000.0, 5000.0, 6000.0, 7000.0]

Retrieve a video frame:

>>> frame = vsource.get_frame(0)
>>> frame.EncodedWidth, frame.EncodedHeight
(128, 72)
>>> frame.planes[0]
array([16, 16, 16, ..., 16, 16, 16], dtype=uint8) is a demo script showing how this package can be used.


To install the package for Python 3, use:

$ ./ install

To install the package for Python 2, use:

$ python2 install

On Windows, you may use one of the MSI binary packages provided on the download page.


The API was designed to be an object-oriented and Pythonic version of the original FFmpegSource API.

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 ffms, version 0.3a2
Filename, size File type Python version Upload date Hashes
Filename, size ffms-0.3a2.tar.bz2 (33.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page