Skip to main content

FFPyPlayer is a python binding for the FFmpeg library for playing and writing media files.

For more information: http://matham.github.io/ffpyplayer/index.html

To install: http://matham.github.io/ffpyplayer/installation.html

TravisCI status Appveyor status Supported Python versions Latest Version on PyPI

Usage example

Playing a file:

>>> from ffpyplayer.player import MediaPlayer
>>> import time

>>> player = MediaPlayer(filename)
>>> val = ''
>>> while val != 'eof':
...     frame, val = player.get_frame()
...     if val != 'eof' and frame is not None:
...         img, t = frame
...         # display img

Writing a video file:

>>> from ffpyplayer.writer import MediaWriter
>>> from ffpyplayer.pic import Image

>>> w, h = 640, 480
>>> # write at 5 fps.
>>> out_opts = {'pix_fmt_in':'rgb24', 'width_in':w, 'height_in':h,
...     'codec':'rawvideo', 'frame_rate':(5, 1)}
>>> writer = MediaWriter('output.avi', [out_opts])

>>> # Construct image
>>> size = w * h * 3
>>> buf = bytearray([int(x * 255 / size) for x in range(size)])
>>> img = Image(plane_buffers=[buf], pix_fmt='rgb24', size=(w, h))

>>> for i in range(20):
...     writer.write_frame(img=img, pts=i / 5., stream=0)

Converting images:

>>> from ffpyplayer.pic import Image, SWScale
>>> w, h = 500, 100
>>> size = w * h * 3
>>> buf = bytearray([int(x * 255 / size) for x in range(size)])

>>> img = Image(plane_buffers=[buf], pix_fmt='rgb24', size=(w, h))
>>> sws = SWScale(w, h, img.get_pixel_format(), ofmt='yuv420p')

>>> img2 = sws.scale(img)
>>> img2.get_pixel_format()
'yuv420p'
>>> planes = img2.to_bytearray()
>>> map(len, planes)
[50000, 12500, 12500, 0]

Release files for ffpyplayer 4.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ffpyplayer 4.2.0
File Size Uploaded
ffpyplayer-4.2.0.tar.gz 71.7 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for ffpyplayer 4.2.0
File
ffpyplayer-4.2.0-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details
ffpyplayer-4.2.0-cp37-cp37m-win32.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-32 Details
ffpyplayer-4.2.0-cp37-cp37m-manylinux2010_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64 Details
ffpyplayer-4.2.0-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.10+ Intel (x86-64, i386), macOS 10.9+ Intel (x86-64, i386), macOS 10.9+ x86-64, macOS 10.10+ x86-64, macOS 10.6+ Intel (x86-64, i386) Details
ffpyplayer-4.2.0-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details
ffpyplayer-4.2.0-cp36-cp36m-win32.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-32 Details
ffpyplayer-4.2.0-cp36-cp36m-manylinux2010_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-64 Details
ffpyplayer-4.2.0-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl CPython 3.6 CPython 3.6 pymalloc macOS 10.9+ Intel (x86-64, i386), macOS 10.9+ x86-64, macOS 10.10+ Intel (x86-64, i386), macOS 10.6+ Intel (x86-64, i386), macOS 10.10+ x86-64 Details
ffpyplayer-4.2.0-cp35-cp35m-win_amd64.whl CPython 3.5 CPython 3.5 pymalloc Windows x86-64 Details
ffpyplayer-4.2.0-cp35-cp35m-win32.whl CPython 3.5 CPython 3.5 pymalloc Windows x86-32 Details
ffpyplayer-4.2.0-cp35-cp35m-manylinux2010_x86_64.whl CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.12+ x86-64 Details
ffpyplayer-4.2.0-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl CPython 3.5 CPython 3.5 pymalloc macOS 10.6+ Intel (x86-64, i386), macOS 10.10+ x86-64, macOS 10.9+ Intel (x86-64, i386), macOS 10.9+ x86-64, macOS 10.10+ Intel (x86-64, i386) Details

Total release size: 277.4 MB

Release files / ffpyplayer-4.2.0.tar.gz

Download URL ffpyplayer-4.2.0.tar.gz
Size 71.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5438fe33679e56193e022590d5df3d8e20f5beb3f88bdb90d2b40131a2423422
BLAKE2b-256 checksum
How to use checksums
70a86426cb8155a613f178b38327e1e9f544b1e9fc32ca00d184fa62ed6cc1c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.5.2

Release files / ffpyplayer-4.2.0-cp37-cp37m-win_amd64.whl

Download URL ffpyplayer-4.2.0-cp37-cp37m-win_amd64.whl
Size 27.2 MB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
9e2e12f44c3bb580d0fd08875a75508b380c6fbead50a59d406b811fc65e5f77
BLAKE2b-256 checksum
How to use checksums
24e9288f6f86e2752e4aa490a7a2c819309357f3115185cdf5f25e59a86f8964
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.5.2

Release files / ffpyplayer-4.2.0-cp37-cp37m-win32.whl

Download URL ffpyplayer-4.2.0-cp37-cp37m-win32.whl
Size 23.6 MB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
7ec21e3e5a0d69084c58d0f04940257c6f055f261ea4fbfa042c575c275ed3d0
BLAKE2b-256 checksum
How to use checksums
c74e9f37a2da4f6404abe73f1731321f1b46a90e86b34d9bcefe636fd50d9ab7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.5.2

Release files / ffpyplayer-4.2.0-cp37-cp37m-manylinux2010_x86_64.whl

Download URL ffpyplayer-4.2.0-cp37-cp37m-manylinux2010_x86_64.whl
Size 25.3 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
ae0a876df7f3f7bb77af41a004baf5be089c3dca94bc05e4d0f520f99c737ca8
BLAKE2b-256 checksum
How to use checksums
c86a86b08df209e2abb8e8cedca612add8b8d13240bcf7495f3871d9af36a71b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.5.2

Release files / ffpyplayer-4.2.0-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl

Download URL ffpyplayer-4.2.0-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Size 24.0 MB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.10+ Intel (x86-64, i386) macOS 10.10+ x86-64 macOS 10.6+ Intel (x86-64, i386) macOS 10.9+ Intel (x86-64, i386) macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
2e8262e291e8e837a2d7923486c68e556ddc962176e2be93a089b843bea2dc6c
BLAKE2b-256 checksum
How to use checksums
69df6020e7ad6bf257677e98b83e9d9986badb9204692309366b2bb74f6c509f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.5.2

Release files / ffpyplayer-4.2.0-cp36-cp36m-win_amd64.whl

Download URL ffpyplayer-4.2.0-cp36-cp36m-win_amd64.whl
Size 27.2 MB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
0d0b3a1937eaeb635c3a6758371dc38e6d7b4808ac8becf6878fdfb2aadbdc44
BLAKE2b-256 checksum
How to use checksums
1657d018c12b5baddd1dd4a1e51cb7f2a0953097ac47fca44da1a4fc7279c86d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.5.2

Release files / ffpyplayer-4.2.0-cp36-cp36m-win32.whl

Download URL ffpyplayer-4.2.0-cp36-cp36m-win32.whl
Size 23.6 MB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
e74637db13206871169b9878b8f2e16543d7be862464e711763b867a5b999e18
BLAKE2b-256 checksum
How to use checksums
4b13c85a57d054564bd403ed16d3b2691fead0d7ccf49a154aff46c65abe0b4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.5.2

Release files / ffpyplayer-4.2.0-cp36-cp36m-manylinux2010_x86_64.whl

Download URL ffpyplayer-4.2.0-cp36-cp36m-manylinux2010_x86_64.whl
Size 25.3 MB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
660bf825813322bfe741ed0ece3fd03cbfae42a795547811e39708b6a7bc8d80
BLAKE2b-256 checksum
How to use checksums
50e2adb08ed0cd0fb3596fe6d8e75b0b04e43cf72ad0ca268c7e22730d816abf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.5.2

Release files / ffpyplayer-4.2.0-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl

Download URL ffpyplayer-4.2.0-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Size 1.0 MB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.10+ Intel (x86-64, i386) macOS 10.10+ x86-64 macOS 10.6+ Intel (x86-64, i386) macOS 10.9+ Intel (x86-64, i386) macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
b6005a746f0763395b18876b539528d68b2b869318ced3012d004277d5cba9c0
BLAKE2b-256 checksum
How to use checksums
9ae8cd2b89d5cdc7a93d303f45e2393b147e7e63be4d8cf335be28f09628067d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.5.2

Release files / ffpyplayer-4.2.0-cp35-cp35m-win_amd64.whl

Download URL ffpyplayer-4.2.0-cp35-cp35m-win_amd64.whl
Size 27.2 MB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
b77282a05fabff44a75381b96d369e2058e50eda8533e7543b034fc9b32e70f4
BLAKE2b-256 checksum
How to use checksums
2a2d5b151075b6714b17aad7b8b4a0eddc3cbbde16e482e648a4962cefb9f460
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.5.2

Release files / ffpyplayer-4.2.0-cp35-cp35m-win32.whl

Download URL ffpyplayer-4.2.0-cp35-cp35m-win32.whl
Size 23.6 MB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
de4a989dd4a57bad4dc8a9a808c6c2a60fd9cd1598c57b1bffe4c657f398d0fd
BLAKE2b-256 checksum
How to use checksums
45593698ce8a994f0e04f59dc1bf035e276458be5d74e52c408681b4a6262fa9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.5.2

Release files / ffpyplayer-4.2.0-cp35-cp35m-manylinux2010_x86_64.whl

Download URL ffpyplayer-4.2.0-cp35-cp35m-manylinux2010_x86_64.whl
Size 25.3 MB
Tags CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
9059a77bb5b14d19f002835ed5f13d4bd5ab62ed092b291a148cf021f918eb96
BLAKE2b-256 checksum
How to use checksums
8832a97b96170d0d77fb89a77cbd17dcf7d23520609596b24b846ae22b26cb4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.5.2

Release files / ffpyplayer-4.2.0-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl

Download URL ffpyplayer-4.2.0-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Size 24.0 MB
Tags CPython 3.5 CPython 3.5 pymalloc macOS 10.10+ Intel (x86-64, i386) macOS 10.10+ x86-64 macOS 10.6+ Intel (x86-64, i386) macOS 10.9+ Intel (x86-64, i386) macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
17940e393e847b12af94fa728ec27d46a290e38306518668ee448ff5498838aa
BLAKE2b-256 checksum
How to use checksums
1d58edc23d10e558f681b533e52092d27ff179cf1009f2a7150598c5c61a381b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.5.2

Release history Release notifications | RSS feed

4.5.3

31 release files

4.5.2

34 release files

4.4.0

24 release files

4.3.5

19 release files

4.3.4

19 release files

4.3.3

19 release files

4.3.2

18 release files

4.3.1

14 release files

4.3.0

14 release files

This release

4.2.0 This release

13 release files

4.1.0

10 release files

4.0.1

21 release files

4.0.0

5 release files

4.0.dev0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page