{"id":2130740,"url":"https://github.com/zeroepoch/plotbitrate","last_synced_at":"2025-04-04T18:07:35.519Z","repository":{"id":11909921,"uuid":"14474572","full_name":"zeroepoch/plotbitrate","owner":"zeroepoch","description":"FFProbe Bitrate Graph","archived":false,"fork":false,"pushed_at":"2024-01-14T01:14:12.000Z","size":87,"stargazers_count":299,"open_issues_count":0,"forks_count":42,"subscribers_count":20,"default_branch":"main","last_synced_at":"2024-05-09T21:10:16.054Z","etag":null,"topics":["bitrate","ffmpeg","matplotlib","python3"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zeroepoch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-17T20:47:55.000Z","updated_at":"2024-08-04T23:30:46.696Z","dependencies_parsed_at":"2023-11-10T23:24:04.807Z","dependency_job_id":"76aab682-5cd6-467b-ad7f-2098f7e90dcc","html_url":"https://github.com/zeroepoch/plotbitrate","commit_stats":{"total_commits":64,"total_committers":5,"mean_commits":12.8,"dds":0.34375,"last_synced_commit":"05cbcbfb78289b4abc9371eca9edb11aa5f5b9b9"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroepoch%2Fplotbitrate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroepoch%2Fplotbitrate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroepoch%2Fplotbitrate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroepoch%2Fplotbitrate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeroepoch","download_url":"https://codeload.github.com/zeroepoch/plotbitrate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226215,"owners_count":20904465,"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":["bitrate","ffmpeg","matplotlib","python3"],"created_at":"2024-01-21T23:26:06.744Z","updated_at":"2025-04-04T18:07:35.496Z","avatar_url":"https://github.com/zeroepoch.png","language":"Python","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"PlotBitrate\n===========\n\nFFProbe Bitrate Graph\n\nThis project contains a script for plotting the bitrate of an audio or video\nstream over time. To get the frame bitrate data ffprobe is used from the ffmpeg\npackage. The ffprobe data is streamed to python as xml frame metadata and\noptionally sorted by frame type. Matplotlib is used to plot the overall bitrate\nor each frame type on the same graph with lines for the peak and mean bitrates.\nThe resulting bitrate graph can be saved as an image.\n\nPossible outputs are:\n* Image types (png, svg, pdf, ...)\n* Raw frame data (csv, xml)\n\nRequirements:\n* Python \u003e= 3.6\n* FFmpeg \u003e= 1.2 with the ffprobe command\n* Matplotlib\n* PyQt5 or PyQt6 (optional for image file output)\n\nFor using the script from source, install the requirements with\n`pip install -r requirements.txt` or use the `requirements-dev.txt`\nfor development purposes.\n\nInstallation\n------------\n\n`pip install plotbitrate`\n\nIf you encounter the error message `qt.qpa.plugin: Could not load the Qt\nplatform plugin \"xcb\" in \"\" even though it was found.` while running\n`plotbitrate`, then you may need to install your distribution's\n`libxcb-cursor0` package. If this package is already installed and/or doesn't\nresolve the issue, then you can try using `QT_DEBUG_PLUGINS=1 plotbitrate\ninput.mkv 2\u003e\u00261 | grep \"No such file\"` to determine if other libraries are\nmissing.\n\nUseful Options\n--------------\n\nThe raw frame data can be stored in an xml file with the option `-f xml_raw`,\nwhich the graph can be plotted from. This is useful if the graph should be\nshown multiple times with different options, as the source file doesn't need to\nbe scanned again.\n\nThe option `--downscale` (or `-d`) is useful if the video is very long and an\noverview of the bitrate fluctuation is sufficient and zooming in is not\nnecessary. This behavior resembles that of the tool \"Bitrate Viewer\". With this\noption, videos will be shown as a downscaled graph, meaning not every second is\nbeing displayed. Multiple seconds will be grouped together and the max value\nwill be drawn. This downscaling is not applied when viewing individual frame\ntypes as this would lead to wrong graphs. This behavior can be adjusted with\nthe `--max-display-values` option. The default value is 700, meaning that at\nmost 700 individual seconds/bars are drawn.\n\nCSV Output\n----------\n\nYou may find it useful to save the raw frame data to a CSV file so the frame\ndata can be processed using another tool. This turns `plotbitrate` into more of\na helper tool rather than a visualization tool.\n\nOne example may be using `gnuplot` to show an impulse plot for every single\nframe split by frame type. Below is an example `gnuplot` script that mimics an\nearlier version of `plotbitrate`.\n\n```\n#!/usr/bin/gnuplot -persist\nset datafile separator \",\"\nplot \"\u003c awk -F, '{if($3 == \\\"I\\\") print}' frames.csv\" u 1:2 t \"I\" w impulses lt rgb \"red\", \\\n     \"\u003c awk -F, '{if($3 == \\\"P\\\") print}' frames.csv\" u 1:2 t \"P\" w impulses lt rgb \"green\", \\\n     \"\u003c awk -F, '{if($3 == \\\"B\\\") print}' frames.csv\" u 1:2 t \"B\" w impulses lt rgb \"blue\"\n```\n\nThe necessary input data can be generated using:\n\n```\nplotbitrate -o frames.csv input.mkv\n```\n\nUsage Examples\n--------------\n\nShow video stream bitrate in a window with progress.\n\n```\nplotbitrate input.mkv\n```\n\nShow downscaled video stream bitrate in a window.\n\n```\nplotbitrate -d input.mkv\n```\n\nShow video stream bitrate for each frame type in a window.\n\n```\nplotbitrate -t input.mkv\n```\n\nSave video stream bitrate to an SVG file.\n\n```\nplotbitrate -o output.svg input.mkv\n```\n\nShow audio stream bitrate in a window.\n\n```\nplotbitrate -s audio input.mkv\n```\n\nSave raw ffproble frame data as xml file.\n\n```\nplotbitrate -f xml_raw -o frames.xml input.mkv\n```\n\nShow bitrate graph from raw xml.\n\n```\nplotbitrate frames.xml\n```\n\nShow the bitrate, but fill the area below the curve with a solid color.\n\n```\nplotbitrate --solid input.mkv\n```\n\nIt's possible to specify a custom `FFPROBE_PATH` in case you don't have it on your `PATH` or want a custom `ffprobe`:\n\n```\n# Unix\nFFPROBE_PATH=/tmp/ffprobe plotbitrate input.mkv\n\n# Windows\nset FFPROBE_PATH=C:\\temp\\ffmpeg\\bin\\ffprobe.exe\nplotbitrate input.mkv\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeroepoch%2Fplotbitrate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeroepoch%2Fplotbitrate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeroepoch%2Fplotbitrate/lists"}