L
L
lehha2012-09-10 16:42:37
Nginx
lehha, 2012-09-10 16:42:37

Nginx to distribute mjpeg stream?

There is a mjpeg stream from ZoneMinder (http). He is always alone (one camera), only there are many clients for him. It turns out that Zoneminder creates a separate cgi-process for each connected client, decently loading the processor.
Is it possible to distribute one thread to all clients on nginx? Or let's say - can he distribute "Content-Type: multipart/x-mixed-replace;boundary=..." without duplicating the source?
It can simply proxy the Zoneminder daemon, but it creates a thread for each client in the same way.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
P
Puma Thailand, 2012-09-10
@opium

It definitely doesn’t natively, you need something like erlyvideo or vlc

V
vsespb, 2012-09-10
@vsespb

5 years ago I wrote a server that inflates mjpeg exactly the way you want. I don't think nginx can. it's not all that trivial. Maybe there is a module.

M
Maxim Kuptsov, 2012-09-10
@nogoody

Once I made a video server via vlc
Received rtsp, gave flv directly to the player

cvlc rtsp://192.168.0.103:554 --sout
'#transcode{vcodec=FLV1,vb=256,fps=4,scale=1,acodec=none,samplerate=22050}:http{dst=:8081/stream.flv}'
--rtsp-cahing=2400 --video --no-sout-audio --udp-caching=30000
--http-caching=5000

this command takes the stream rtsp://192.168.0.103:554 and retransmits
it on port 8081 at /stream4.flv
cache parameters obtained empirically, for each locale in different ways
For your case, change vcodec under mjpeg

O
Omni, 2013-12-07
@Omni

4.livejournal.com/57552.html?thread=2557392#t2557392 - I didn't find any other way to report, everything is cut off :-) Sorry for the unsuccessful attempt to publish and the loss of your comment.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question