A cython implementation of an ffmpeg based player.
Project description
FFPyPlayer is a python binding for the FFmpeg library for playing and writing media files.
For more information: https://matham.github.io/ffpyplayer/index.html
To install: https://matham.github.io/ffpyplayer/installation.html
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]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file ffpyplayer-4.3.4.tar.gz
.
File metadata
- Download URL: ffpyplayer-4.3.4.tar.gz
- Upload date:
- Size: 88.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 186354d54e320f7b6b4474d12b593140a4203c279c8374a3a345c1a593bf9cd2 |
|
MD5 | 57101e1e1b715d77eb051783a5747ad4 |
|
BLAKE2b-256 | b5fb8507d362d3c5770ff5bd57bfa6bd537b0124ccfd8e41a28d2e591bb7d59e |
Provenance
File details
Details for the file ffpyplayer-4.3.4-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: ffpyplayer-4.3.4-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 55.8 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b3a777a1b04155fae85b6e64d4ce73c587574c94c34eeb610cec8948c5b8546 |
|
MD5 | ed8a20c1e73e4056726661a0848c7198 |
|
BLAKE2b-256 | 27b8a55bcd9c7f381523405eaaa10046a63b270e5ee7a8e2c9814a73ca307e8d |
Provenance
File details
Details for the file ffpyplayer-4.3.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: ffpyplayer-4.3.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 27.7 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d586a40b48c1703fc0330a5e89b909d49292b94ca3102a69b9cda1149df9939 |
|
MD5 | 0430a979ec20f78dbb4d4a1878351242 |
|
BLAKE2b-256 | a5a10342935c9a0b028b262c22892a8191e3d6dd1547fdf9a7672a81b23fb3ba |
Provenance
File details
Details for the file ffpyplayer-4.3.4-cp310-cp310-macosx_11_0_arm64.whl
.
File metadata
- Download URL: ffpyplayer-4.3.4-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 16.8 MB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04fd355d64de36e037368a51036860d61013d54ca74de52c73e3494ac38c2d28 |
|
MD5 | ec661372817ca0303ce3147307d0e659 |
|
BLAKE2b-256 | 17e42fb950fa53b6d259c83fc13f86a0ea78f838b5cf2fc192c6d2c9efecf742 |
Provenance
File details
Details for the file ffpyplayer-4.3.4-cp310-cp310-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: ffpyplayer-4.3.4-cp310-cp310-macosx_10_9_x86_64.whl
- Upload date:
- Size: 19.9 MB
- Tags: CPython 3.10, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 456ee937897223f45111b5cdd825368213756e8823711a6bc9049c98dc0e2038 |
|
MD5 | bcad0219011e567dbb7bcaa0e9caf22b |
|
BLAKE2b-256 | c567f32285bb66bcae48f4d8c2fb6e2823110fcabcaacf6db0071473e971931a |
Provenance
File details
Details for the file ffpyplayer-4.3.4-cp310-cp310-macosx_10_9_universal2.whl
.
File metadata
- Download URL: ffpyplayer-4.3.4-cp310-cp310-macosx_10_9_universal2.whl
- Upload date:
- Size: 36.9 MB
- Tags: CPython 3.10, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61ac00f412747f370151fe39d4cb1197e370ab88157ec4904a927fa7d1656f01 |
|
MD5 | b63d7d84fca4ed08350ceb999bbed0e1 |
|
BLAKE2b-256 | 4777bb2c466b6b17117a338ae219960c5a2553314532608c63c971fc13225336 |
Provenance
File details
Details for the file ffpyplayer-4.3.4-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: ffpyplayer-4.3.4-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 55.8 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd74174c8a653a8d00e515bd3296019199307ca8645c29bd3e9f60f2d59b8814 |
|
MD5 | d870a259c91072c9919264f3f9554d1b |
|
BLAKE2b-256 | d74b66eb8c3b23ed1502b96f38ae61d82704648c8e1bbbc8af5ebc52de390574 |
Provenance
File details
Details for the file ffpyplayer-4.3.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: ffpyplayer-4.3.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 27.7 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12f7cf7818483058fd8e93f79329382dfea4f3e6bf408cf1e3ebd3443580921a |
|
MD5 | b0c55dcabcd70482faedbfcdd0a9f35a |
|
BLAKE2b-256 | 279de6010f13e7ac2ddb545cd09c0eb0ae7dd4c587f49fe90a8e3ec552f624b1 |
Provenance
File details
Details for the file ffpyplayer-4.3.4-cp39-cp39-macosx_11_0_arm64.whl
.
File metadata
- Download URL: ffpyplayer-4.3.4-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 16.8 MB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45cfe691fb85a6979e53c1f9349f2dad3c0823abae251152a7ddaf8c43fa3cb0 |
|
MD5 | 766e3cfdf1145d7b77b1a5503549d29b |
|
BLAKE2b-256 | b98ee3a0f7c4c1330301c7b77e29aac289ec0656a53b3f30da34dbc059b358d7 |
Provenance
File details
Details for the file ffpyplayer-4.3.4-cp39-cp39-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: ffpyplayer-4.3.4-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 19.9 MB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf62e1bf8ebdf12aa11f034a89b776406a66dc3da6d8a452ddef99d14a443015 |
|
MD5 | 9d2c12ddf451509fbeab6fd954467c64 |
|
BLAKE2b-256 | b7ff47ffa0065750ca8f32c18f3f22bbf05652b3b23fced026b037999e91cdb3 |
Provenance
File details
Details for the file ffpyplayer-4.3.4-cp39-cp39-macosx_10_9_universal2.whl
.
File metadata
- Download URL: ffpyplayer-4.3.4-cp39-cp39-macosx_10_9_universal2.whl
- Upload date:
- Size: 36.9 MB
- Tags: CPython 3.9, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b967446406d8ed81dd28f7b2cb135458be1707efe4f28c666abc997655991583 |
|
MD5 | cc7dfd9c083b51f68bf409ecbd7d6695 |
|
BLAKE2b-256 | 12768d63600b24dc3426e1d761ae9cce018ad47e6e681199fe22af332bc5187c |
Provenance
File details
Details for the file ffpyplayer-4.3.4-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: ffpyplayer-4.3.4-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 55.8 MB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbce68a70bb9f7215d4dc2b94737c5916e785b0f7ca89635b4215d42a905c41c |
|
MD5 | 309c1c00a780f39e8f26113daa94a99e |
|
BLAKE2b-256 | 1900767b2bdae2d4b227e9401f19745d1cabee0b4e625f46c3e30b849b575eb3 |
Provenance
File details
Details for the file ffpyplayer-4.3.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: ffpyplayer-4.3.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 27.7 MB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49381af726a997acb517b385218ae405042110f77b30363e3411e9d12681298f |
|
MD5 | a42b0fc14f9c9377b0d34b66f22f6067 |
|
BLAKE2b-256 | de7e2e4831366406163c93a62648d9b24547126d4348d04678aba7635927510e |
Provenance
File details
Details for the file ffpyplayer-4.3.4-cp38-cp38-macosx_11_0_arm64.whl
.
File metadata
- Download URL: ffpyplayer-4.3.4-cp38-cp38-macosx_11_0_arm64.whl
- Upload date:
- Size: 16.8 MB
- Tags: CPython 3.8, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9dd1d5135d8f26e1a01e60cd1b33519bcdb6c7faa8176c8f3b1a17a9f3f35119 |
|
MD5 | 979871759ec521ab47663d6561aa1cc4 |
|
BLAKE2b-256 | 642a3b075d89bb838258fb7a05b5e9d7b87bf35268378364d82ac4dc1687082c |
Provenance
File details
Details for the file ffpyplayer-4.3.4-cp38-cp38-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: ffpyplayer-4.3.4-cp38-cp38-macosx_10_9_x86_64.whl
- Upload date:
- Size: 19.9 MB
- Tags: CPython 3.8, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad7e64f609864935cdaa927a42d47c6c6d6dfdf8ce65e6d960d85788c761a49c |
|
MD5 | cd2a6861e8627d9a824294e294d79cd1 |
|
BLAKE2b-256 | 22580e464c4a1ed4ea4b176903ca0034e1d8a2973eae38444f3336e34ce3f415 |
Provenance
File details
Details for the file ffpyplayer-4.3.4-cp38-cp38-macosx_10_9_universal2.whl
.
File metadata
- Download URL: ffpyplayer-4.3.4-cp38-cp38-macosx_10_9_universal2.whl
- Upload date:
- Size: 36.9 MB
- Tags: CPython 3.8, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e48c0d2b27516aceec70a41e8687277a072d3a1c7085b460d4236eff55835ef |
|
MD5 | d6bd8ff626c1ee0549975d7af91c3522 |
|
BLAKE2b-256 | 68aa6dd6a391c0a3378032170c2ba82b434089103d66454654f9d7aa3515be9c |
Provenance
File details
Details for the file ffpyplayer-4.3.4-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: ffpyplayer-4.3.4-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 55.8 MB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e5814a87265960c5da47f06bab5cfd294f6c81a7f9391fa3d738af1fa37e4d4 |
|
MD5 | 7d7c0893abd03522fc8d25ce67079d9c |
|
BLAKE2b-256 | e6c3aa2d92ca277323e6d5e0be532431b514d4a2e244e8409f58a6ff9d06ef7d |
Provenance
File details
Details for the file ffpyplayer-4.3.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: ffpyplayer-4.3.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 27.5 MB
- Tags: CPython 3.7m, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33475bf5c7320ccd5b6b8c1622b4f767a2bb866ea169568a05be98fc35bc6e6a |
|
MD5 | d2832bc7011f0be663782ef2e9f9a09b |
|
BLAKE2b-256 | 6368f6b09fc7a1350cbd74d699b5defa3047c01f30e8df620288c5175953a030 |
Provenance
File details
Details for the file ffpyplayer-4.3.4-cp37-cp37m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: ffpyplayer-4.3.4-cp37-cp37m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 19.9 MB
- Tags: CPython 3.7m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6c703d746d8dfd056c53770f339be588de69bc7a149fa93fb3841ba46c936ed |
|
MD5 | 60702634c00829766ddc7f206f1375f9 |
|
BLAKE2b-256 | 0e9256206b61c4b0302f1a89279f56ded893cc95902a99073f27f267aab3f674 |