dank074 / Discord-video-stream

Experiment for making video streaming work for discord selfbots.
180 stars 32 forks source link

RTCP Sender Report #55

Closed longnguyen2004 closed 8 months ago

longnguyen2004 commented 8 months ago

This is still very WIP, missing a few pieces and having some problems that I haven't root caused yet. However it's in a good enough state that other people can test and improve on.

Note: The current implementation timestamps the packet when sendFrame() is called. If there are extra processing steps before it that causes the audio and video streams to go out of sync, this will not fix it.

TODO:

dank074 commented 8 months ago

Haven't experienced the Unknown (-1)" audio codec bug, even when streaming for prolonged periods of time (for 100+ viewers who didn't report it happening either).

I don't know if the ssrc will ever change mid stream.

Good work so far 👀

longnguyen2004 commented 8 months ago

Then it's probably a problem with my client or something else. I managed to catch a failure while stress testing, and asking other people to join and check also didn't reveal anything unusual.

longnguyen2004 commented 8 months ago

Note about the send interval:

The RFC specifies that

Since implementing them would create unnecessary complexity, and we aren't trying to be standard compliant (we just need it to work), I've came up with estimates for the intervals that would result in ~5 seconds between reports. Feel free to tweak the formula if I'm wrong though.

longnguyen2004 commented 8 months ago

This should be good enough to be taken out of draft

For other people testing this, please check for:

longnguyen2004 commented 8 months ago

My results after 10 hours of continuous streaming:

Edit: Please hold while I test further

longnguyen2004 commented 8 months ago

Turns out whatever problems I have is due to me using RTSP (note to self: always use SRT). Code is fine and is good to go.