{"id":13905669,"url":"https://github.com/matham/ffpyplayer","last_synced_at":"2025-05-15T20:02:03.384Z","repository":{"id":11788593,"uuid":"14330651","full_name":"matham/ffpyplayer","owner":"matham","description":"A cython implementation of an ffmpeg based player.","archived":false,"fork":false,"pushed_at":"2025-03-23T06:10:04.000Z","size":31858,"stargazers_count":137,"open_issues_count":41,"forks_count":38,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-01T01:37:52.335Z","etag":null,"topics":["ffmpeg","python","video-player"],"latest_commit_sha":null,"homepage":null,"language":"Cython","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matham.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-11-12T11:42:39.000Z","updated_at":"2025-03-23T06:07:17.000Z","dependencies_parsed_at":"2024-06-18T16:16:55.834Z","dependency_job_id":"b0b0a5f9-ce71-4e37-85de-a06fbcc3be48","html_url":"https://github.com/matham/ffpyplayer","commit_stats":{"total_commits":367,"total_committers":13,"mean_commits":28.23076923076923,"dds":0.08174386920980925,"last_synced_commit":"62daeee1e7ddc88dba05ae7b69e0a02e7dce69cb"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matham%2Fffpyplayer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matham%2Fffpyplayer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matham%2Fffpyplayer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matham%2Fffpyplayer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matham","download_url":"https://codeload.github.com/matham/ffpyplayer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247766247,"owners_count":20992433,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ffmpeg","python","video-player"],"created_at":"2024-08-06T23:01:20.865Z","updated_at":"2025-04-08T02:37:38.427Z","avatar_url":"https://github.com/matham.png","language":"Cython","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"FFPyPlayer is a python binding for the FFmpeg library for playing and writing\nmedia files.\n\nFor more information: https://matham.github.io/ffpyplayer/index.html\n\nTo install: https://matham.github.io/ffpyplayer/installation.html\n\n.. image:: https://travis-ci.org/matham/ffpyplayer.svg?branch=master\n    :target: https://travis-ci.org/matham/ffpyplayer\n    :alt: TravisCI status\n\n.. image:: https://ci.appveyor.com/api/projects/status/nfl6tyiwks26ngyu/branch/master?svg=true\n    :target: https://ci.appveyor.com/project/matham/ffpyplayer/branch/master\n    :alt: Appveyor status\n\n.. image:: https://img.shields.io/pypi/pyversions/ffpyplayer.svg\n    :target: https://pypi.python.org/pypi/ffpyplayer/\n    :alt: Supported Python versions\n\n.. image:: https://img.shields.io/pypi/v/ffpyplayer.svg\n    :target: https://pypi.python.org/pypi/ffpyplayer/\n    :alt: Latest Version on PyPI\n\n.. warning::\n\n    Although the ffpyplayer source code is licensed under the LGPL, the ffpyplayer wheels\n    for Windows and linux on PYPI are distributed under the GPL because the included FFmpeg binaries\n    were compiled with GPL options.\n\n    If you want to use it under the LGPL you need to compile FFmpeg yourself with the correct options.\n\n    Similarly, the wheels bundle openssl for online camera support. However, releases are not made\n    for every openssl release, so it is recommended that you compile ffpyplayer yourself if security\n    is a issue.\n\nUsage example\n-------------\n\nPlaying a file:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e from ffpyplayer.player import MediaPlayer\n    \u003e\u003e\u003e import time\n\n    \u003e\u003e\u003e player = MediaPlayer(filename)\n    \u003e\u003e\u003e val = ''\n    \u003e\u003e\u003e while val != 'eof':\n    ...     frame, val = player.get_frame()\n    ...     if val != 'eof' and frame is not None:\n    ...         img, t = frame\n    ...         # display img\n\nWriting a video file:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e from ffpyplayer.writer import MediaWriter\n    \u003e\u003e\u003e from ffpyplayer.pic import Image\n\n    \u003e\u003e\u003e w, h = 640, 480\n    \u003e\u003e\u003e # write at 5 fps.\n    \u003e\u003e\u003e out_opts = {'pix_fmt_in':'rgb24', 'width_in':w, 'height_in':h,\n    ...     'codec':'rawvideo', 'frame_rate':(5, 1)}\n    \u003e\u003e\u003e writer = MediaWriter('output.avi', [out_opts])\n\n    \u003e\u003e\u003e # Construct image\n    \u003e\u003e\u003e size = w * h * 3\n    \u003e\u003e\u003e buf = bytearray([int(x * 255 / size) for x in range(size)])\n    \u003e\u003e\u003e img = Image(plane_buffers=[buf], pix_fmt='rgb24', size=(w, h))\n\n    \u003e\u003e\u003e for i in range(20):\n    ...     writer.write_frame(img=img, pts=i / 5., stream=0)\n\nConverting images:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e from ffpyplayer.pic import Image, SWScale\n    \u003e\u003e\u003e w, h = 500, 100\n    \u003e\u003e\u003e size = w * h * 3\n    \u003e\u003e\u003e buf = bytearray([int(x * 255 / size) for x in range(size)])\n\n    \u003e\u003e\u003e img = Image(plane_buffers=[buf], pix_fmt='rgb24', size=(w, h))\n    \u003e\u003e\u003e sws = SWScale(w, h, img.get_pixel_format(), ofmt='yuv420p')\n\n    \u003e\u003e\u003e img2 = sws.scale(img)\n    \u003e\u003e\u003e img2.get_pixel_format()\n    'yuv420p'\n    \u003e\u003e\u003e planes = img2.to_bytearray()\n    \u003e\u003e\u003e map(len, planes)\n    [50000, 12500, 12500, 0]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatham%2Fffpyplayer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatham%2Fffpyplayer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatham%2Fffpyplayer/lists"}