Follow

Hm I wonder how hard it is to proxy/cache mjpegstreamer. I want to make a publicly-viewable stream of the webcam of Princess...

· · Web · 3 · 0 · 2

@s0 Transcoding to h264 and segmenting for hls makes proxying/caching with nginx infinitely easier.

@sophie yeah fair, I've implemented an nginx HLS stream proxy-cacher for work, but it also needs a video.js frontend page to run. guess I can set up a static thing

@sophie but also, having a container sitting there transcoding 24/7 without guarantee of having any clients watching seems like a fair waste of power, so I might just stick with the Go mjpeg proxy-cache server I found.

@s0 There should be a few options with varying complexity.
I'm not familiar with the current state of things, but probably would go into two directions:
Have something chop the stream into chunks for DASH or HLS. Potentially ffmpeg. To avoid constant bandwidth use you could have a local HTTP server that hosts those and a caching reverse proxy on a server (exclude playlist from cache!).
Something really simple around Icecast and (on-demand) relaying. "Legacy" mode where just passes bitstream.

@tbr I'm happy with what I found -- a go server that just proxy-caches the MJPEG stream from the OctoPrint source and handles sending to clients. That way if there are no clients, there's no additional transcoding happening. I don't care quite enough to have ffmpeg transcoding 24/7. I've implemented that kind of HLS proxy server before but it is more complex. I don't really care about the worse performance & browser support of MJPEG compared to HLS.

@s0 Great that you found something simple that fits the bill!

@avalon (it’s black right now because it’s night lol)

Sign in to participate in the conversation
Cathode Church

A place for trans makers, coders, tinkerers and dreamers.