{"id":13607565,"url":"https://github.com/ashellunts/ffmpeg-to-webrtc","last_synced_at":"2025-04-12T14:30:38.158Z","repository":{"id":39443092,"uuid":"406110238","full_name":"ashellunts/ffmpeg-to-webrtc","owner":"ashellunts","description":"Stream video from ffmpeg to web(rtc)","archived":false,"fork":false,"pushed_at":"2022-10-30T20:30:20.000Z","size":1377,"stargazers_count":947,"open_issues_count":0,"forks_count":55,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-11-07T13:36:53.332Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/ashellunts.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}},"created_at":"2021-09-13T19:53:42.000Z","updated_at":"2024-10-31T01:06:48.000Z","dependencies_parsed_at":"2022-07-16T23:30:46.943Z","dependency_job_id":null,"html_url":"https://github.com/ashellunts/ffmpeg-to-webrtc","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/ashellunts%2Fffmpeg-to-webrtc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashellunts%2Fffmpeg-to-webrtc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashellunts%2Fffmpeg-to-webrtc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashellunts%2Fffmpeg-to-webrtc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ashellunts","download_url":"https://codeload.github.com/ashellunts/ffmpeg-to-webrtc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248580990,"owners_count":21128088,"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":[],"created_at":"2024-08-01T19:01:19.743Z","updated_at":"2025-04-12T14:30:37.602Z","avatar_url":"https://github.com/ashellunts.png","language":"Go","funding_links":[],"categories":["Media API","HarmonyOS","Go"],"sub_categories":["Windows Manager"],"readme":"# ffmpeg-to-webrtc\n\nffmpeg-to-webrtc demonstrates how to send video from ffmpeg to your browser using [pion](https://github.com/pion/webrtc).\n\n## How to run it\n\n### Open example web page\n[jsfiddle.net](https://jsfiddle.net/wjo4e9c7/1/)\n\n### Copy browser's SDP\nIn the jsfiddle the top textarea is your browser's SDP, copy that to clipboard.\n\n#### Windows\n1. `cd src`\n1. Paste the SDP into a file `src/SDP.txt`.\n2. Make sure ffmpeg in your PATH and golang is installed.\n3. Run `go run . \u003cffmpeg command line options\u003e - \u003c SDP.txt`\n4. Note dash after ffmpeg options. It makes ffmpeg to write output to stdout. The app will read h264 stream from ffmpeg stdout.\n5. ffmpeg output format should be h264. Browsers don't support all h264 profiles so it may not always work. Here is an example of format that works: `-pix_fmt yuv420p -c:v libx264 -bsf:v h264_mp4toannexb -b:v 2M -max_delay 0 -bf 0 -f h264`.\n\n### Put SDP from ffmpeg-to-webrtc into your browser\nWhen you see SDP in base64 format printed it means that SDP is already in clipboard. So you can go to jsfiddle page and paste that into Application SDP text area.\n\n### Hit 'Start Session' in jsfiddle\nA video should start playing in your browser below the input boxes.\n\n## Examples (windows)\n### Share camera stream\n```go run . -rtbufsize 100M -f dshow -i video=\"PUT_DEVICE_NAME\" -pix_fmt yuv420p -c:v libx264 -bsf:v h264_mp4toannexb -b:v 2M -max_delay 0 -bf 0 -f h264 - \u003c SDP```. \nThere is a delay of several seconds. Should be possible to fix it with better ffmpeg configuration.\n\nTo check list of devices: `ffmpeg -list_devices true -f dshow -i dummy`.  \nIt is possible also to set a resolution and a format, for example `-pixel_format yuyv422 -s 640x480`.\nPossible formats: `ffmpeg -list_options true -f dshow -i video=PUT_DEVICE_NAME`.\n### Share screen or window\nSee `.bat` files in src folder\n\n## Linux, macOS\n\nShould work on other operating systems, though I haven't tried.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashellunts%2Fffmpeg-to-webrtc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashellunts%2Fffmpeg-to-webrtc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashellunts%2Fffmpeg-to-webrtc/lists"}