Skip to content

What is the streaming protocol used in Weylus? #305

Answered by H-M-H
KarimElsayad247 asked this question in Q&A
Discussion options

You must be logged in to vote

Weylus sends fragmented mp4 frames with one video stream encoded using the H.264 codec as binary messages over the websocket connection. See

Weylus/ts/lib.ts

Lines 946 to 960 in d30b8b3

if (msg == "NewVideo") {
let MS = window.ManagedMediaSource ? window.ManagedMediaSource : window.MediaSource;
mediaSource = new MS();
sourceBuffer = null;
video.src = URL.createObjectURL(mediaSource);
mediaSource.addEventListener("sourceopen", (_) => {
let mimeType = 'video/mp4; codecs="avc1.4D403D"';
if (!MS.isTypeSupported(mimeType))
mimeType = "video/mp4";
sourceBuffer = mediaSource.addSourceBuffer(mimeType);
sourceBuffer.addEventListener("up…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by KarimElsayad247
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants