-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add moq-sub to subscribe to media from moq relays #133
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @Frando these are well done
while let Some(fragment) = segment.fragment().await? { | ||
trace!("segment={} fragment={}", segment.sequence, fragment.sequence); | ||
let buf = Self::recv_fragment(fragment).await?; | ||
out.lock().await.write_all(&buf).await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine although we will need to handle this better eventually. MoQ is meant to be lossy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The segments are already received in parallel. Your suggestion would be to also receive fragments in parallel?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, the fragments need to be written in order for playback to work. We either need separate files for each segment (like HLS/DASH), or drop the previous segment on each new segment. The current code will interleave fragments from different segments which won't playback.
Feel free to merge this and my other PR :) I am not working on these further for the time being. |
Working on updating this to the new API. |
This adds a simple
moq-sub
tool which allows to connect to a moq relay and subscribe to a broadcast. It expects the format as published bymoq-pub
, and will then dump the first video and first audio track to stdout. By pipingmoq-sub
into e.g.ffplay
you can play media from a moq relay.Also includes a
dev/sub
script that works without further arguments when usingdev/relay
anddev/pub
.Also added an optional
AUDIO=1
env var todev/pub
to not skip audio tracks.