OliverF / mjpeg-relay

Relays any given MJPEG stream
MIT License
66 stars 23 forks source link

Connects OK but no stream #16

Open strickerconsulting opened 7 years ago

strickerconsulting commented 7 years ago

Hi,

I am trying to use the mjpeg-relay to relay a IP camera mjpeg stream. When launching the streamer, everything is looking fine. The terminal looks like this:

andre@rs209835:~/mjpeg-relay$ python relay.py -d -w 54018 http://admin:****@dyndns-host:8091/mjpeg/stream.cgi?chn=1 Starting new HTTP connection (1): dyndns-host send: 'GET /mjpeg/stream.cgi?chn=1 HTTP/1.1\r\nHost: dyndns-host:8091\r\nAccept: /\r\nAccept-Encoding: gzip, deflate\r\nAuthorization: Basic YWRtaW46MTIzNDU2\r\nUser-Agent: python-requests/2.3.0 CPython/2.7.3 Linux/3.2.0-102-generic\r\n\r\n' reply: 'HTTP/1.1 401 Unauthorized\r\n' header: WWW-Authenticate: Digest realm="IPCamera Login", nonce="d2196ed82d421beea792716429f434d0", qop="auth" header: Content-Type: text/html header: Content-Length: 351 header: Connection: close header: Date: Tue, 07 Mar 2017 21:09:09 GMT header: Server: lighttpd/1.4.35 "GET /mjpeg/stream.cgi?chn=1 HTTP/1.1" 401 351 send: 'GET /mjpeg/stream.cgi?chn=1 HTTP/1.1\r\nHost: dyndns-host:8091\r\nAuthorization: Digest username="admin", realm="IPCamera Login", nonce="d2196ed82d421beea792716429f434d0", uri="/mjpeg/stream.cgi?chn=1", response="caf37f39406629b9aee0eba02ded2e75", qop="auth", nc=00000001, cnonce="bb118369fb119c46"\r\nAccept-Encoding: gzip, deflate\r\nAccept: /\r\nUser-Agent: python-requests/2.3.0 CPython/2.7.3 Linux/3.2.0-102-generic\r\n\r\n' reply: 'HTTP/1.1 200 OK\r\n' header: Cache-Control: public,max-age=0 header: Accept-Ranges: bytes header: Content-Type: multipart/x-mixed-replace;boundary=ipcamera header: Connection: close header: Transfer-Encoding: chunked header: Date: Tue, 07 Mar 2017 21:09:10 GMT header: Server: lighttpd/1.4.35 "GET /mjpeg/stream.cgi?chn=1 HTTP/1.1" 200 None Connected to stream source, boundary separator: --ipcamera

I can see the to-be-relayed stream OK from the internet and on my local network. When I run the mjpeg-relay, I can see the status page and I do see a incoming bandwidth. When I connect to the /stream URL, I do see that the outbound bandwidth goes up. But 1. I do not see the mjpeg in the browser/-Tag. 2. Also VLC does not play the outgoing stream. I tried running the relay on a different server but makes no difference. Anything else I can look at?

Silex commented 7 years ago

Does the /snapshot url displays a snapshot? Can you paste the result of curl --raw -v http://localhost:54321/stream somewhere (I want to look at the headers).

My guess right now is that Transfer-Encoding: chunked confuses the parser.

strickerconsulting commented 7 years ago

No. The returning image is empty (also double checked wget - resulting file is empty)

strickerconsulting commented 7 years ago

curl --raw -v http://timemelter.com:54321/stream

Silex commented 7 years ago

Ok, give https://github.com/Silex/mjpeg-relay/tree/chunked-encoding-support a try and report.

Btw, in your above paste after the headers there's nothing?

My commit is based on http://docs.python-requests.org/en/master/user/advanced/#chunk-encoded-requests

strickerconsulting commented 7 years ago

andre@rs209835:~$ git clone https://github.com/Silex/mjpeg-relay/tree/chunked-encoding-support Cloning into 'chunked-encoding-support'... error: The requested URL returned error: 403 while accessing https://github.com/Silex/mjpeg-relay/tree/chunked-encoding-support/info/refs fatal: HTTP request failed

To your question: No. I assume it will run into a timeout eventually

On 07.03.2017 22:47, Philippe Vaucher wrote:

Give https://github.com/Silex/mjpeg-relay/tree/chunked-encoding-support a try and report.

Btw, in your above paste after the headers there's nothing?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OliverF/mjpeg-relay/issues/16#issuecomment-284870086, or mute the thread https://github.com/notifications/unsubscribe-auth/AZC178CqdwRT5z0hNc7joa0EaFhktsfLks5rjdBggaJpZM4MWCGv.

-- André Stricker Stricker Consulting

Lindenstrasse 45 D-35398 Gießen Germany Tel: +49 (0)641-33055205-0 Fax: +49 (0)641-33055205-9 Mob: +49 (0)179 29 43 130 e-Mail: stricker@scw-services.com www.scw-services.com

Silex commented 7 years ago
git clone git://github.com/Silex/mjpeg-relay
git checkout chunked-encoding-support
strickerconsulting commented 7 years ago

Ah thanks.

Done that. When I run the relay now, it looks ok again, but the /status page show no incoming bandwidth..

python relay.py -d -w 54018 http://admin:****@dyn-url:8091/mjpeg/stream.cgi?chn=1 Starting new HTTP connection (1): dyn-url send: 'GET /mjpeg/stream.cgi?chn=1 HTTP/1.1\r\nHost: dyn-url:8091\r\nAccept: /\r\nAccept-Encoding: gzip, deflate\r\nAuthorization: Basic YWRtaW46MTIzNDU2\r\nUser-Agent: python-requests/2.3.0 CPython/2.7.3 Linux/3.2.0-102-generic\r\n\r\n' reply: 'HTTP/1.1 401 Unauthorized\r\n' header: WWW-Authenticate: Digest realm="IPCamera Login", nonce="0c84df3082134992e588ef7d1dfe739f", qop="auth" header: Content-Type: text/html header: Content-Length: 351 header: Connection: close header: Date: Tue, 07 Mar 2017 22:04:09 GMT header: Server: lighttpd/1.4.35 "GET /mjpeg/stream.cgi?chn=1 HTTP/1.1" 401 351 send: 'GET /mjpeg/stream.cgi?chn=1 HTTP/1.1\r\nHost: dyn-url:8091\r\nAuthorization: Digest username="admin", realm="IPCamera Login", nonce="0c84df3082134992e588ef7d1dfe739f", uri="/mjpeg/stream.cgi?chn=1", response="c7d421e513fa43b1e48079761fcf6896", qop="auth", nc=00000001, cnonce="10cbc87611e2c11f"\r\nAccept-Encoding: gzip, deflate\r\nAccept: /\r\nUser-Agent: python-requests/2.3.0 CPython/2.7.3 Linux/3.2.0-102-generic\r\n\r\n' reply: 'HTTP/1.1 200 OK\r\n' header: Cache-Control: public,max-age=0 header: Accept-Ranges: bytes header: Content-Type: multipart/x-mixed-replace;boundary=ipcamera header: Connection: close header: Transfer-Encoding: chunked header: Date: Tue, 07 Mar 2017 22:04:09 GMT header: Server: lighttpd/1.4.35 "GET /mjpeg/stream.cgi?chn=1 HTTP/1.1" 200 None Connected to stream source, boundary separator: --ipcamera

mjpeg-relay status Summary Parameter Value Clients 0 Incoming bandwidth 0.0000Mb/s Outgoing bandwidth 0.0000Mb/s

Silex commented 7 years ago

Please use a pastebin or use github's code blocks.

Anyway, you are sure http://admin:****@dyndns-host:8091/mjpeg/stream.cgi?chn=1 works properly? Is it possible to setup some temporary viewer user for us to use?

strickerconsulting commented 7 years ago

Hm. I just rebooted the camera and it didn't come up again. Camera is on rooftop. I will have to double check tomorrow. I will get back. Sorry for the delay and thanks for the support

On 07.03.2017 23:11, Philippe Vaucher wrote:

Please use a pastebin or use github's code blocks.

Anyway, you are sure |http://admin:****@dyndns-host:8091/mjpeg/stream.cgi?chn=1| works properly? Is it possible to setup some temporary viewer user for us to use?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OliverF/mjpeg-relay/issues/16#issuecomment-284876647, or mute the thread https://github.com/notifications/unsubscribe-auth/AZC1724bEduve3V84rJKFwwnN88XEZgCks5rjdX-gaJpZM4MWCGv.

-- André Stricker Stricker Consulting

Lindenstrasse 45 D-35398 Gießen Germany Tel: +49 (0)641-33055205-0 Fax: +49 (0)641-33055205-9 Mob: +49 (0)179 29 43 130 e-Mail: stricker@scw-services.com www.scw-services.com

strickerconsulting commented 7 years ago

Here u go.

http://test:test@dev.scw-services.com:8091/mjpeg/stream.cgi?chn=1

I tried relaying this stream as well but no luck.

On 07.03.2017 23:11, Philippe Vaucher wrote:

Please use a pastebin or use github's code blocks.

Anyway, you are sure |http://admin:****@dyndns-host:8091/mjpeg/stream.cgi?chn=1| works properly? Is it possible to setup some temporary viewer user for us to use?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OliverF/mjpeg-relay/issues/16#issuecomment-284876647, or mute the thread https://github.com/notifications/unsubscribe-auth/AZC1724bEduve3V84rJKFwwnN88XEZgCks5rjdX-gaJpZM4MWCGv.

-- André Stricker Stricker Consulting

Lindenstrasse 45 D-35398 Gießen Germany Tel: +49 (0)641-33055205-0 Fax: +49 (0)641-33055205-9 Mob: +49 (0)179 29 43 130 e-Mail: stricker@scw-services.com www.scw-services.com

OliverF commented 7 years ago

Hello,

Just had a quick attempt, looks like that gives a 401 even when connecting directly without using mjpeg-relay. Please check the credentials

strickerconsulting commented 7 years ago

Camera is down again. Will climb up there tomorrow morning and get back. Thanks already!

On 08.03.2017 00:08, OliverF wrote:

Hello,

Just had a quick attempt, looks like that gives a 401 even when connecting directly without using mjpeg-relay. Please check the credentials

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OliverF/mjpeg-relay/issues/16#issuecomment-284890455, or mute the thread https://github.com/notifications/unsubscribe-auth/AZC1758cc5Ai4l_KlSY4flH0vuIrn_9Fks5rjeNTgaJpZM4MWCGv.

-- André Stricker Stricker Consulting

Lindenstrasse 45 D-35398 Gießen Germany Tel: +49 (0)641-33055205-0 Fax: +49 (0)641-33055205-9 Mob: +49 (0)179 29 43 130 e-Mail: stricker@scw-services.com www.scw-services.com

Silex commented 7 years ago

The credentials are fine, you need to use digest auth.

The problem is more like the camera only accepts very few connections... curl -v --raw --anyauth "http://test:test@dev.scw-services.com:8091/mjpeg/stream.cgi?chn=1" timeouts before sending the stream.

In all my attempts it only sent the MJPG once, and thus I could not debug.