{ "info": { "author": "spirit", "author_email": "hiddenspirit@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2" ], "description": "ffms2 \u2013 Python bindings for FFmpegSource\n========================================\n\nThis project is a fork that supports more recent versions of FFMS.\nThe original repository can be found at https://bitbucket.org/spirit/ffms.\n\nExample usage\n-------------\n\nIf you don't need to keep the index, create a video source right away:\n\n```python-console\n>>> import ffms2\n>>> source_file = \"test/CINT_Nik_H264_720_512kb.mp4\"\n>>> vsource = ffms2.VideoSource(source_file)\n```\n\nOr you can create an indexer:\n\n```python-console\n>>> indexer = ffms2.Indexer(source_file)\n>>> indexer.format_name\n'mov,mp4,m4a,3gp,3g2,mj2'\n>>> indexer.track_info_list\n[TrackInfo(type=0, codec_name='h264'), TrackInfo(type=1, codec_name='aac')]\n```\n\nThen create the index for the video source:\n\n```python-console\n>>> for track in indexer.track_info_list:\n>>> indexer.track_index_settings(track.num, 1, 0)\n>>> index = indexer.do_indexing2()\n>>> track_number = index.get_first_indexed_track_of_type(ffms2.FFMS_TYPE_VIDEO)\n>>> vsource = ffms2.VideoSource(source_file, track_number, index)\n```\n\nExtract information from the video source:\n\n```python-console\n>>> vsource.properties.NumFrames\n1430\n>>> vsource.track.keyframes[:5]\n[0, 12, 24, 36, 48]\n>>> vsource.track.timecodes[:5]\n[0.0, 41.666666666666664, 83.33333333333333, 125.0, 166.66666666666666]\n```\n\nRetrieve a video frame:\n\n```python-console\n>>> frame = vsource.get_frame(0)\n>>> frame.EncodedWidth, frame.EncodedHeight\n(416, 240)\n>>> frame.planes[0]\narray([41, 41, 41, ..., 41, 41, 41], dtype=uint8)\n```\n\nAudio stuff:\n\n```python-console\n>>> track_number = index.get_first_indexed_track_of_type(ffms2.FFMS_TYPE_AUDIO)\n>>> asource = ffms2.AudioSource(source_file, track_number, index)\n>>> aprops = asource.properties\n>>> aprops.SampleRate, aprops.BitsPerSample, aprops.Channels\n(48000, 16, 2)\n>>> min_audio, max_audio = float(\"inf\"), float(\"-inf\")\n>>> for audio in asource.linear_access(rate=100):\n... if audio.min() < min_audio:\n... min_audio = audio.min()\n... if audio.max() > max_audio:\n... max_audio = audio.max()\n>>> min_audio, max_audio\n(-16191, 18824)\n```\n\n`ffmsinfo.py` is a demo script showing how this package can be used.\n\nInstallation\n------------\n\nTo install the package for Python 3, use:\n\n```console\n$ ./setup.py install\n```\n\nPrerequisites\n-------------\n\n- [Python 3.2+](http://www.python.org)\n- [FFmpegSource](https://github.com/FFMS/ffms2)\n- [numpy](http://www.numpy.org)\n\nThe API was designed to be an object-oriented and Pythonic version of the\noriginal [FFmpegSource\nAPI](https://github.com/FFMS/ffms2/blob/master/doc/ffms2-api.md).", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/rr-/pyffms2", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "ffms2", "package_url": "https://pypi.org/project/ffms2/", "platform": "", "project_url": "https://pypi.org/project/ffms2/", "project_urls": { "Homepage": "https://github.com/rr-/pyffms2" }, "release_url": "https://pypi.org/project/ffms2/0.4.3/", "requires_dist": null, "requires_python": ">=3.2", "summary": "Bindings for FFmpegSource", "version": "0.4.3" }, "last_serial": 5349842, "releases": { "0.4": [ { "comment_text": "", "digests": { "md5": "1e6f154922cda748e013706e17a1c53a", "sha256": "320146fd4282748ca13cb087b30e6b5412efd161a4d9b8ab6c90da2f3590b225" }, "downloads": -1, "filename": "ffms2-0.4.tar.gz", "has_sig": false, "md5_digest": "1e6f154922cda748e013706e17a1c53a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21774, "upload_time": "2019-05-17T06:57:10", "url": "https://files.pythonhosted.org/packages/5c/6d/1adecff2790fe3915bb6922ad3966ee220144581e1c0e040c6eeb244735a/ffms2-0.4.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "f47484336ad4bf4437421d0b985de7ee", "sha256": "8db162ef60dbd5a97882463391c8c98d4cfcaa19149e0b91eb6beb0951e7cb89" }, "downloads": -1, "filename": "ffms2-0.4.1.tar.gz", "has_sig": false, "md5_digest": "f47484336ad4bf4437421d0b985de7ee", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21787, "upload_time": "2019-05-17T07:01:02", "url": "https://files.pythonhosted.org/packages/e0/a9/4154e1abebfa11819b152883d504eba1636a7b5d78a8d974bea397b95d9c/ffms2-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "623ccf3b04d943eda1213dff13814b16", "sha256": "4820b889bb21a72dee2c314188aee9a02265d186f09625521502947761e0a1e3" }, "downloads": -1, "filename": "ffms2-0.4.2.tar.gz", "has_sig": false, "md5_digest": "623ccf3b04d943eda1213dff13814b16", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.2", "size": 16933, "upload_time": "2019-05-17T07:16:40", "url": "https://files.pythonhosted.org/packages/52/36/ec2f34469914d73999d27c10430b1c400396d4941ca45377dd8624e75e7b/ffms2-0.4.2.tar.gz" } ], "0.4.3": [ { "comment_text": "", "digests": { "md5": "9c27d60d924c31dcf46efdbe3be88d9c", "sha256": "c00876d92e4f8a0fef2e77f33992129d0f97c125b3bea095e2e1dc5ca2d5f3f7" }, "downloads": -1, "filename": "ffms2-0.4.3.tar.gz", "has_sig": false, "md5_digest": "9c27d60d924c31dcf46efdbe3be88d9c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.2", "size": 17351, "upload_time": "2019-06-02T20:34:10", "url": "https://files.pythonhosted.org/packages/27/e9/5bc14de45825fa58cbc49377256b470ed6fe82044f9496710b1d58c3d302/ffms2-0.4.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9c27d60d924c31dcf46efdbe3be88d9c", "sha256": "c00876d92e4f8a0fef2e77f33992129d0f97c125b3bea095e2e1dc5ca2d5f3f7" }, "downloads": -1, "filename": "ffms2-0.4.3.tar.gz", "has_sig": false, "md5_digest": "9c27d60d924c31dcf46efdbe3be88d9c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.2", "size": 17351, "upload_time": "2019-06-02T20:34:10", "url": "https://files.pythonhosted.org/packages/27/e9/5bc14de45825fa58cbc49377256b470ed6fe82044f9496710b1d58c3d302/ffms2-0.4.3.tar.gz" } ] }