{ "info": { "author": "Werner Robitza", "author_email": "werner.robitza@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Multimedia :: Video" ], "description": "FFmpeg Bitrate Stats\n====================\n\nSimple script for calculating bitrate statistics using FFmpeg.\n\nAuthor: Werner Robitza werner.robitza@gmail.com\n\nContents:\n\n- `Requirements <#requirements>`__\n- `Installation <#installation>`__\n- `Usage <#usage>`__\n- `Output <#output>`__\n- `License <#license>`__\n\n--------------\n\nRequirements\n------------\n\n- Python 3.6\n- FFmpeg:\n\n - download a static build from `their\n website `__\n - put the ``ffprobe`` executable in your ``$PATH``\n\n- ``pip3 install -r requirements.txt``\n\nInstallation\n------------\n\n::\n\n pip install ffmpeg_bitrate_stats\n\nOr clone this repository, then run the tool with\n``python -m ffmpeg_bitrate_stats``\n\nUsage\n-----\n\nThe script outputs a bunch of bitrate statistics, including aggregations\nfor pre-defined windows. These windows can either be time-based or\nGOP-based (for video streams). When choosing a time-based window, you\ncan specify the size of the chunks in seconds.\n\nOutput is to STDOUT so you can redirect that to a file or another\nscript.\n\nSee ``ffmpeg_bitrate_stats -h``:\n\n::\n\n usage: ffmpeg_bitrate_stats [-h] [-n] [-v] [-s {video,audio}]\n [-a {time,gop}] [-c CHUNK_SIZE]\n [-of {json,csv}]\n input\n\n positional arguments:\n input input file\n\n optional arguments:\n -h, --help show this help message and exit\n -n, --dry-run Do not run command, just show what would be done\n (default: False)\n -v, --verbose Show verbose output (default: False)\n -s {video,audio}, --stream-type {video,audio}\n Stream type to analyze (default: video)\n -a {time,gop}, --aggregation {time,gop}\n Window for aggregating statistics, either time-based\n (per-second) or per GOP (default: time)\n -c CHUNK_SIZE, --chunk-size CHUNK_SIZE\n Custom aggregation window size in seconds (default:\n 1.0)\n -of {json,csv}, --output-format {json,csv}\n output in which format (default: json)\n\nOutput\n------\n\nThe output can be JSON, which includes individual fields for each chunk,\nor CSV, which repeats each line for each chunk. The CSV adheres to the\n\u201ctidy\u201d data concept, so it\u2019s a little redundant.\n\nRates are given in kilobit per second, using SI prefixes (i.e., kilo =\n1000).\n\nExplanation of the fields:\n\n- ``input_file``: Path to the input file\n- ``stream_type``: Type of stream used (video, audio)\n- ``avg_fps``: Average FPS (number of frames divided by duration)\n- ``num_frames``: Number of frames\n- ``avg_bitrate``: Average bitrate\n- ``avg_bitrate_over_chunks``: Average bitrate calculated over the\n chunks\n- ``max_bitrate``: Maximum bitrate calculated over the chunks\n- ``min_bitrate``: Minimum bitrate calculated over the chunks\n- ``max_bitrate_factor``: Relation between peak and average\n- ``bitrate_per_chunk``: Individual bitrates for each chunk\n- ``aggregation``: Type of aggregation used\n- ``chunk_size``: Size of the chunk (when aggregation is \u201ctime\u201d)\n- ``duration``: Total duration of the stream (last frame DTS minus\n first DTS)\n\nJSON example:\n\n::\n\n \u279c ffmpeg_bitrate_stats -a time -c 30 -of json BigBuckBunny.mp4\n {\n \"input_file\": \"BigBuckBunny.mp4\",\n \"stream_type\": \"video\",\n \"avg_fps\": 60.002,\n \"num_frames\": 38072,\n \"avg_bitrate\": 8002.859,\n \"avg_bitrate_over_chunks\": 7849.263,\n \"max_bitrate\": 14565.117,\n \"min_bitrate\": 3876.533,\n \"max_bitrate_factor\": 1.82,\n \"bitrate_per_chunk\": [\n 8960.89,\n 8036.678,\n 6099.959,\n 4247.879,\n 7276.979,\n 5738.383,\n 7740.339,\n 7881.705,\n 7572.594,\n 8387.719,\n 9634.343,\n 9939.488,\n 9365.104,\n 5061.071,\n 14565.117,\n 9725.483,\n 4573.873,\n 7765.041,\n 9796.135,\n 12524.024,\n 3876.533,\n 3914.455\n ],\n \"aggregation\": \"time\",\n \"chunk_size\": 30.0,\n \"duration\": 634.517\n }\n\nCSV example:\n\n::\n\n \u279c ffmpeg_bitrate_stats -a time -c 30 -of csv BigBuckBunny.mp4\n input_file,chunk_index,stream_type,avg_fps,num_frames,avg_bitrate,avg_bitrate_over_chunks,max_bitrate,min_bitrate,max_bitrate_factor,bitrate_per_chunk,aggregation,chunk_size,duration\n BigBuckBunny.mp4,0,video,60.002,38072,8002.859,7849.263,14565.117,3876.533,1.82,8960.89,time,30.0,634.517\n BigBuckBunny.mp4,1,video,60.002,38072,8002.859,7849.263,14565.117,3876.533,1.82,8036.678,time,30.0,634.517\n BigBuckBunny.mp4,2,video,60.002,38072,8002.859,7849.263,14565.117,3876.533,1.82,6099.959,time,30.0,634.517\n BigBuckBunny.mp4,3,video,60.002,38072,8002.859,7849.263,14565.117,3876.533,1.82,4247.879,time,30.0,634.517\n BigBuckBunny.mp4,4,video,60.002,38072,8002.859,7849.263,14565.117,3876.533,1.82,7276.979,time,30.0,634.517\n BigBuckBunny.mp4,5,video,60.002,38072,8002.859,7849.263,14565.117,3876.533,1.82,5738.383,time,30.0,634.517\n BigBuckBunny.mp4,6,video,60.002,38072,8002.859,7849.263,14565.117,3876.533,1.82,7740.339,time,30.0,634.517\n BigBuckBunny.mp4,7,video,60.002,38072,8002.859,7849.263,14565.117,3876.533,1.82,7881.705,time,30.0,634.517\n BigBuckBunny.mp4,8,video,60.002,38072,8002.859,7849.263,14565.117,3876.533,1.82,7572.594,time,30.0,634.517\n BigBuckBunny.mp4,9,video,60.002,38072,8002.859,7849.263,14565.117,3876.533,1.82,8387.719,time,30.0,634.517\n BigBuckBunny.mp4,10,video,60.002,38072,8002.859,7849.263,14565.117,3876.533,1.82,9634.343,time,30.0,634.517\n BigBuckBunny.mp4,11,video,60.002,38072,8002.859,7849.263,14565.117,3876.533,1.82,9939.488,time,30.0,634.517\n BigBuckBunny.mp4,12,video,60.002,38072,8002.859,7849.263,14565.117,3876.533,1.82,9365.104,time,30.0,634.517\n BigBuckBunny.mp4,13,video,60.002,38072,8002.859,7849.263,14565.117,3876.533,1.82,5061.071,time,30.0,634.517\n BigBuckBunny.mp4,14,video,60.002,38072,8002.859,7849.263,14565.117,3876.533,1.82,14565.117,time,30.0,634.517\n BigBuckBunny.mp4,15,video,60.002,38072,8002.859,7849.263,14565.117,3876.533,1.82,9725.483,time,30.0,634.517\n BigBuckBunny.mp4,16,video,60.002,38072,8002.859,7849.263,14565.117,3876.533,1.82,4573.873,time,30.0,634.517\n BigBuckBunny.mp4,17,video,60.002,38072,8002.859,7849.263,14565.117,3876.533,1.82,7765.041,time,30.0,634.517\n BigBuckBunny.mp4,18,video,60.002,38072,8002.859,7849.263,14565.117,3876.533,1.82,9796.135,time,30.0,634.517\n BigBuckBunny.mp4,19,video,60.002,38072,8002.859,7849.263,14565.117,3876.533,1.82,12524.024,time,30.0,634.517\n BigBuckBunny.mp4,20,video,60.002,38072,8002.859,7849.263,14565.117,3876.533,1.82,3876.533,time,30.0,634.517\n BigBuckBunny.mp4,21,video,60.002,38072,8002.859,7849.263,14565.117,3876.533,1.82,3914.455,time,30.0,634.517\n\nLicense\n-------\n\nffmpeg_bitrate_stats, Copyright (c) 2019 Werner Robitza\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\u201cSoftware\u201d), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \u201cAS IS\u201d, WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/slhck/ffmpeg-bitrate-stats", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "ffmpeg_bitrate_stats", "package_url": "https://pypi.org/project/ffmpeg_bitrate_stats/", "platform": "", "project_url": "https://pypi.org/project/ffmpeg_bitrate_stats/", "project_urls": { "Homepage": "https://github.com/slhck/ffmpeg-bitrate-stats" }, "release_url": "https://pypi.org/project/ffmpeg_bitrate_stats/0.1/", "requires_dist": null, "requires_python": "", "summary": "Calculate bitrate statistics using FFmpeg", "version": "0.1" }, "last_serial": 5316209, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "9e66abe9a99593e74c26647ccd46ab6c", "sha256": "9e2b6a3b128223dba6f9f0e742a9389e0c8b03830071d293c2d6b384478aeeb0" }, "downloads": -1, "filename": "ffmpeg_bitrate_stats-0.1.tar.gz", "has_sig": false, "md5_digest": "9e66abe9a99593e74c26647ccd46ab6c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8903, "upload_time": "2019-05-25T11:46:09", "url": "https://files.pythonhosted.org/packages/16/d6/b357e1493f2f7ef881afa2e874051df083f93083913676e8329ee8007af7/ffmpeg_bitrate_stats-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9e66abe9a99593e74c26647ccd46ab6c", "sha256": "9e2b6a3b128223dba6f9f0e742a9389e0c8b03830071d293c2d6b384478aeeb0" }, "downloads": -1, "filename": "ffmpeg_bitrate_stats-0.1.tar.gz", "has_sig": false, "md5_digest": "9e66abe9a99593e74c26647ccd46ab6c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8903, "upload_time": "2019-05-25T11:46:09", "url": "https://files.pythonhosted.org/packages/16/d6/b357e1493f2f7ef881afa2e874051df083f93083913676e8329ee8007af7/ffmpeg_bitrate_stats-0.1.tar.gz" } ] }