{"id":16889887,"url":"https://github.com/t-mullen/mediastream-to-webm","last_synced_at":"2025-04-11T13:08:38.797Z","repository":{"id":137583707,"uuid":"118953971","full_name":"t-mullen/mediastream-to-webm","owner":"t-mullen","description":"Convert MediaStreams to live WebM streams.","archived":false,"fork":false,"pushed_at":"2019-11-25T00:41:26.000Z","size":85,"stargazers_count":15,"open_issues_count":5,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-25T09:21:28.459Z","etag":null,"topics":["mediastream","p2p","webm","webrtc"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/t-mullen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-01-25T18:51:46.000Z","updated_at":"2023-01-23T20:18:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"53997357-7960-48da-bbd2-2d11f6daa6d0","html_url":"https://github.com/t-mullen/mediastream-to-webm","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/t-mullen%2Fmediastream-to-webm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t-mullen%2Fmediastream-to-webm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t-mullen%2Fmediastream-to-webm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t-mullen%2Fmediastream-to-webm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/t-mullen","download_url":"https://codeload.github.com/t-mullen/mediastream-to-webm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248404690,"owners_count":21097805,"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":["mediastream","p2p","webm","webrtc"],"created_at":"2024-10-13T16:59:36.061Z","updated_at":"2025-04-11T13:08:38.756Z","avatar_url":"https://github.com/t-mullen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mediastream-to-webm\n\nConverts MediaStreams to live WebM streams. Currently only for Chrome.\n\nAllows you to send video/audio as a single outgoing data stream to many peers.\n\n## Features\n- Packages webm clusters and headers into standalone chunks that don't require the entire stream.\n- Fixes MSE problems with timestamp gaps.\n- Abstracts away recording and source buffers.\n\n## Install\n```javascript\nvar MediaStreamToWebm = require('mediastream-to-webm')\n```\n\n```html\n\u003cscript src=\"dist/mediastream-to-webm.js\" /\u003e\n```\n\n## Usage\n\n```javascript\n// Wrap your MediaStream into an encoder\nvar encodedStream = MediaStreamToWebm.EncodedStream(mediaStream)\n\n// The encoded stream is a ReadableStream\nencodedStream.pipe(socket1) \nencodedStream.pipe(socket2) // pipe as many times as you want, at any time, without worrying about the structure of the stream\nencodedStream.pipe(socket2)\n// ...\n```\n\n```javascript\nvar decodedStream = MediaStreamToWebm.DecodedStream()\nsocket.pipe(decodedStream) // pipe the encoded stream into the decoded\n\n// The buffered video element is available for us to watch!\nvar video = decodedStream.videoElement\nvideo.autoplay = true\nvideo.oncanplay = function () {\n    video.play()\n}\ndocument.body.appendChild(video) \n```\n\n## API\n### `MediaStreamToWebm.EncodedStream(mediaStream, opts)`\nEncode a MediaStream into a webm data stream.\n\n`mediaStream` - The input MediaStream you want to broadcast.\n\n`opts` - Options object. Default is:\n\n```javascript\n{\n    interval: 10,\n    mimeType: 'video/webm; codecs=\"opus,vp8\"'\n}\n```\n\n### `MediaStreamToWebm.DecodedStream(opts)`\nDecode an encoded webm data stream. Decoded data will be buffered into a video element.\n\n`opts` - Options object. Default is:\n\n```javascript\n{\n    videoElement: null, // specify an existing video element\n    mimeType: 'video/webm; codecs=\"opus,vp8\"'\n}\n```\n\n## `DecodedStream.videoElement`\nThe video element that will be buffered with the decoded webm stream.\n\n## Notes\n- Currently only works on Chrome (Firefox refuses to accept a webm stream from their own MediaRecorder...)\n- This module has additional overhead for live streaming. If you want just want a prerecorded stream, use `media-recorder-stream`.\n- Headers are sent with every chunk and this packaged needs to be decoded. You won't be able to pass the data stream directly into a webm player.\n- Less efficient and versatile than sending MediaStreams over WebRTC. This \"dumb\" video stream is not meant to be a replacement for the adaptive bitrate, network-aware SRTP protocol used by WebRTC.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft-mullen%2Fmediastream-to-webm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ft-mullen%2Fmediastream-to-webm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft-mullen%2Fmediastream-to-webm/lists"}