{"id":13822869,"url":"https://github.com/Tangent128/webmetro","last_synced_at":"2025-05-16T17:32:26.385Z","repository":{"id":150691518,"uuid":"129694221","full_name":"Tangent128/webmetro","owner":"Tangent128","description":"Utilities for relaying live WebM video/audio streams","archived":false,"fork":false,"pushed_at":"2022-05-23T00:53:24.000Z","size":321,"stargazers_count":43,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-07-18T11:06:09.457Z","etag":null,"topics":["rust","streaming-audio","streaming-video","webm"],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/Tangent128.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2018-04-16T06:18:08.000Z","updated_at":"2023-11-02T09:09:53.000Z","dependencies_parsed_at":"2023-05-05T15:56:01.519Z","dependency_job_id":null,"html_url":"https://github.com/Tangent128/webmetro","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tangent128%2Fwebmetro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tangent128%2Fwebmetro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tangent128%2Fwebmetro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tangent128%2Fwebmetro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tangent128","download_url":"https://codeload.github.com/Tangent128/webmetro/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":213893314,"owners_count":15653524,"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":["rust","streaming-audio","streaming-video","webm"],"created_at":"2024-08-04T08:02:21.596Z","updated_at":"2024-08-04T08:09:08.833Z","avatar_url":"https://github.com/Tangent128.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# webmetro\n\n`webmetro` is a simple relay server for broadcasting a WebM stream from one uploader to many downloaders, via HTTP.\n\nThe initialization segment is remembered, so that viewers can join mid-stream.\n\nCluster timestamps are rewritten to be monotonic, so multiple (compatibly-encoded) webm files can be chained together without clients needing to reconnect.\n\n## Building\n\nDependencies \u0026 building are handed by Cargo:\n\n`cargo build --release`\n\nIf you're feeling bold, you can let Cargo install it for you:\n\n`cargo install`\n\n## Usage\n\nLaunch a relay server with the `relay` subcommand:\n\n`webmetro relay localhost:8080`\n\nAt this point you can open http://localhost:8080/live/main in a web browser. (Or replace \"main\" with any stream name you like)\n\nNext, a source client will need to `POST` or `PUT` a stream to that URL; a static file can be uploaded with the `send` subcommand:\n\n`webmetro send --throttle http://localhost:8080/live/main \u003c file.webm`\n\nYou can even glue together multiple files, provided they share the same codecs and track order:\n\n`cat 1.webm 2.webm 3.webm | webmetro send --throttle http://localhost:8080/live/main`\n\nYou can use ffmpeg to transcode a non-WebM file or access a media device:\n\n`ffmpeg -i file.mp4 -deadline realtime -threads 4 -vb 700k -vcodec libvpx -f webm -live 1 - | webmetro send --throttle http://localhost:8080/live/main`\n\n(if the source is itself a live stream, you can leave off the `--throttle` flag)\n\n## Limitations\n\n* HTTPS is not supported yet. It really should be. (see \"Nginx Proxying\" below, though)\n* There aren't any access controls on either the source or viewer roles yet. (see \"Nginx Proxying\" below, though)\n* The server tries to start a viewer at a cluster containing a keyframe; it is not yet smart enough to ensure that the keyframe belongs to the *video* stream.\n* The server doesn't parse any metadata, such as tags; the Info segment is stripped out, everything else is blindly passed along.\n* The server drops any source that it feels uses too much buffer space. This is not yet configurable, though sane files probably won't hit the limit. (Essentially, clusters \u0026 the initialization segment can't individually be more than 2M)\n\n## Nginx Proxying\n\nTo get around the current lack of native HTTPS support, you can have nginx terminate the SSL connection; likewise you can have nginx handle access control.\n\nThe proxy block will need to include at least the following:\n\n```nginx\nlocation /webmetro/ {\n    # needed to stream PUT request bodies properly\n    proxy_http_version 1.1;\n    proxy_request_buffering off;\n    client_max_body_size 0;\n\n    # alternatively you may wish to bar PUT requests so only local clients can transmit\n    # proxy_method GET;\n\n    # proxy to a relay server that's only listening on localhost\n    proxy_pass http://localhost:8080/;\n}\n```\n\nThis is also useful to simply have the same public port shared by webmetro and a nicely-formatted viewer page.\n\n## See Also\n\n* the [Icecast](http://www.icecast.org/) streaming server likewise relays media streams over HTTP, and supports additional non-WebM formats such as Ogg. It does not support clients connecting to a stream before the source, however.\n\n## License\n\n`webmetro` is licensed under the MIT license; see the LICENSE file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTangent128%2Fwebmetro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTangent128%2Fwebmetro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTangent128%2Fwebmetro/lists"}