Ask HN: FFmpeg real-time desktop streaming
11–17 of 17 posts
Re: Ask HN: FFmpeg real-time desktop streaming
#12I would also recommend OBS as another commentator has mentioned. I believe in both cases you will need an RTSP server to handle multiple client connections. I looked into a similar ffmpeg solution a couple of months ago and broadcast an libx264 video only stream with ~1 second latency to an rtsp server: https://gist.github.com/andrewmackrodt/88c2233fb9cc4797ada93... However, I found this solution to be too CPU intens…
Also linking a config file I commented for an example. Unsure if it'll still work and it could definitely be simplified for OP's needs. It was a proof of concept for a streaming service I was thinking up before realising how much money I don't have, haha
https://github.com/arut/nginx-rtmp-module
https://gist.github.com/cohan/7f676d3f561be62d0550785c015f00...
Re: Ask HN: FFmpeg real-time desktop streaming
#13If you want AV1 you will not be able to use RTMP. The protocol is orphaned/deprecated, so avoid if possible!
If I was building it this is what I would do, and my reasoning.
* For capture + encoding I would use OBS. You will want to use something that is easy for users to install configure. Professors will also have lots of custom requirements when it comes to layout etc... it will be tempting to do a ffmpeg command directly, but it will fall apart quick I believe.
* To get AV1 out of OBS I would use FFMPEG output. I would have it send RTP. RTP is used to carry video in a sub-second manner. This is the same protocol that WebRTC uses. You know have AV1 + low latency.
* Then for users to watch I would use WebRTC. That will allow them to watch in their web browser. Conceptually it will be like this https://github.com/pion/webrtc/tree/master/examples/rtp-to-w... this takes the RTP packets and puts them in the browser.
Lots of great projects exist that you could use for 'RTP -> WebRTC' like https://galene.org/ and https://livekit.io/ I would suggest checking them all out!
If you have more questions/want to talk to people in the video space always happy to chat on https://pion.ly/slack :)
Re: Ask HN: FFmpeg real-time desktop streaming
#14Now do you have a streaming server, where the students will connect to? If not you can put something simple together with nginx and RTMP.
Re: Ask HN: FFmpeg real-time desktop streaming
#15If you're after very low latency, then try Mjpeg. Most modern compressions are temporal, there will always be a several frames lag.
Re: Ask HN: FFmpeg real-time desktop streaming
#16Re: Ask HN: FFmpeg real-time desktop streaming
#17 * how to create content for a stream
* how to broadcast that stream to viewers
Which one are you trying to solve?