{"id":24300001,"url":"https://github.com/4ndrs/purewebm","last_synced_at":"2025-03-06T11:44:17.337Z","repository":{"id":59460763,"uuid":"533070983","full_name":"4ndrs/PureWebM","owner":"4ndrs","description":"Wrapper around ffmpeg to encode quick size restricted webms","archived":false,"fork":false,"pushed_at":"2024-01-07T18:18:26.000Z","size":247,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T17:49:53.811Z","etag":null,"topics":["cli","ffmpeg","ffmpeg-wrapper","purewebm","python","unix-socket","webm"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/4ndrs.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":"2022-09-05T21:52:39.000Z","updated_at":"2023-01-31T20:20:02.000Z","dependencies_parsed_at":"2024-01-07T18:54:13.937Z","dependency_job_id":null,"html_url":"https://github.com/4ndrs/PureWebM","commit_stats":{"total_commits":161,"total_committers":1,"mean_commits":161.0,"dds":0.0,"last_synced_commit":"f582f84322db4ccbd605332fd1b0040c614fb98c"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4ndrs%2FPureWebM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4ndrs%2FPureWebM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4ndrs%2FPureWebM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4ndrs%2FPureWebM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/4ndrs","download_url":"https://codeload.github.com/4ndrs/PureWebM/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242206001,"owners_count":20089251,"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":["cli","ffmpeg","ffmpeg-wrapper","purewebm","python","unix-socket","webm"],"created_at":"2025-01-16T22:19:57.382Z","updated_at":"2025-03-06T11:44:17.308Z","avatar_url":"https://github.com/4ndrs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PureWebM\n\nOriginally written for [PureMPV](https://github.com/4ndrs/PureMPV), with this utility it is possible to encode webms from a given input, according to a restricted file size or a default CRF (Constant Rate Factor). If the utility is called whilst encoding, additional webm parameters will be put in a queue using Unix sockets.\n\n## Usage\nTo encode a quick webm with the defaults:\n```console\n$ purewebm -ss 00:00:02.268 -to 00:00:10.310 -i \"/tmp/Videos/nijinosaki.mkv\" \nEncoding 1 of 1: 100%\n```\nOnly the video stream will be mapped (no audio) with a size limit of 3MB, and saved under ```$HOME/Videos/PureWebM```.\n\nTo encode a webm with size limit of 6MB, burned subtitles, and opus audio:\n```console\n$ purewebm -i \"/tmp/Videos/nijinosaki.mkv\" --size_limit 6 -subs --extra_params '-map 0:a -c:a libopus -b:a 128k'\nEncoding 1 of 1: 100%\n```\n\nIt is possible to request usage instructions through the ```--help``` or ```-h``` option flags:\n```console\n$ purewebm --help\nusage: purewebm [-h] [--version] (--status | --kill | --input INPUT) [--name_type {unix,md5}]\n                [--subtitles] [--encoder ENCODER] [--start_time START_TIME] [--stop_time STOP_TIME]\n                [--lavfi LAVFI] [--size_limit SIZE_LIMIT] [--crf CRF] [--cpu-used {0,1,2,3,4,5}]\n                [--deadline {good,best}] [--extra_params EXTRA_PARAMS]\n                [output]\n\nUtility to encode quick webms with ffmpeg\n\npositional arguments:\n  output                the output file, if not set, the filename will be generated according to\n                        --name_type and saved in $HOME/Videos/PureWebM\n\noptions:\n  -h, --help            show this help message and exit\n  --version, -v         show program's version number and exit\n  --status              queries the main process and prints the current status\n  --kill                sends the kill command to the main process; this will terminate all\n                        encodings immediately, with no cleanups\n  --input INPUT, -i INPUT\n                        the input file to encode (NOTE: several files can be selected adding more\n                        -i flags just like with ffmpeg, these will be only for a single output\n                        file; to encode different files run this program multiple times, the files\n                        will be queued in the main process using Unix sockets)\n  --name_type {unix,md5}, -nt {unix,md5}\n                        the filename type to be generated if the output file is not set: unix uses\n                        the current time in microseconds since Epoch, md5 uses the filename of the\n                        input file with a short MD5 hash attached (default is unix)\n  --subtitles, -subs    burn the subtitles onto the output file; this flag will automatically use\n                        the subtitles found in the first input file, to use a different file use\n                        the -lavfi flag with the subtitles filter directly\n  --encoder ENCODER, -c:v ENCODER\n                        the encoder to use (default is libvpx-vp9)\n  --start_time START_TIME, -ss START_TIME\n                        the start time offset (same as ffmpeg's -ss)\n  --stop_time STOP_TIME, -to STOP_TIME\n                        the stop time (same as ffmpeg's -to)\n  --lavfi LAVFI, -lavfi LAVFI\n                        the set of filters to pass to ffmpeg\n  --size_limit SIZE_LIMIT, -sl SIZE_LIMIT\n                        the size limit of the output file in megabytes, use 0 for no limit (default\n                        is 3)\n  --crf CRF, -crf CRF   the crf to use (default is 24)\n  --cpu-used {0,1,2,3,4,5}, -cpu-used {0,1,2,3,4,5}\n                        the cpu-used for libvpx-vp9; a number between 0 and 5 inclusive, the higher\n                        the number the faster the encoding will be with a quality trade-off\n                        (default is 0)\n  --deadline {good,best}, -deadline {good,best}\n                        the deadline for libvpx-vp9; good is the recommended one, best has the best\n                        compression efficiency but takes the most time (default is good)\n  --extra_params EXTRA_PARAMS, -ep EXTRA_PARAMS\n                        the extra parameters to pass to ffmpeg, these will be appended making it\n                        possible to override some defaults\n```\n\nLogs are saved under ```$HOME/.config/PureWebM/PureWebM.log```\n\n## Configuration file\n\nSome of the default options can be changed using a configuration file named ```PureWebM.conf``` in the configuration folder. Changeable options are ```size_limit```, ```crf```, and ```deadline```. The following is an example of a configuration file:\n\n```bash\n# ~/.config/PureWebM/PureWebM.conf\nsize_limit=4\ncrf=28\ndeadline=good\n```\n\n## Installation\n\nIt can be installed using pip:\n```console\n$ pip install purewebm\n```\nor\n```bash\n$ git clone https://github.com/4ndrs/PureWebM.git\n$ cd PureWebM\n$ pip install .\n```\nAlternatively, [pipx](https://github.com/pypa/pipx) can be used if \u003cstrong\u003ePEP 668\u003c/strong\u003e is enforced:\n\n```console\n$ pipx install purewebm\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4ndrs%2Fpurewebm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F4ndrs%2Fpurewebm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4ndrs%2Fpurewebm/lists"}