searching a mjpeg stream url including credentials for newer firmwares

TVT73

Pulling my weight
Joined
Aug 29, 2016
Messages
406
Reaction score
108
Location
Germany
Hello,
i am trying to get for newer IPC cams a mjpeg stream. Best would be the cifs stream.
It should be used to be displayed on an AVM Fritz Fon.

So the IPC Cam can be used as a door cam on a dect phone.

Setting up live images from an IP camera for FRITZ!Fon | FRITZ!Fon C5 | AVM International
https://en.avm.de/service/fritzfon/fritzfon-c5/knowledge-base/publication/show/1602_Setting-up-live-images-from-an-IP-camera-for-FRITZ-Fon/
Unfortunately, I am not able to get the mjpeg stream with credentials. When i test it, vlc is asking for username and password.
C# Camera SDK: How to connect to your Dahua IP camera

Has something changed in the api of dahua? or anybody an idea how to get the right stream?
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
include username/password in the URI, like
Code:
rtsp://username:password@IP:554/realmonitor?channel=1&subtype=1
Subtype 0 = Main
Subtype 1 = 1st Substream
Subtype 2 = 2nd Substream

You'll have to setup the codec to be MJPEG directly on the camera for the streams you want.. The credentials are local camera credentials.. I suggest making a user for this app so it dont lock out your admin account.
 

TVT73

Pulling my weight
Joined
Aug 29, 2016
Messages
406
Reaction score
108
Location
Germany
Like the AVM knowledge base mentioned, it must be a http stream. Rtsp is not possible.
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
then your shit out of luck, the only http MJPEG stream is the main stream.. and im sure you dont want to record or try to stream that.
 

TVT73

Pulling my weight
Joined
Aug 29, 2016
Messages
406
Reaction score
108
Location
Germany
Last edited:

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
encode the login into the URI and try, the last camera I tried to get http substream in MJPEG turned the entire camera into MJPEG on all streams..

Code:
http://username:password@192.168.100.51/axis-cgi/mjpg/video.cgi?subtype=1
 

TVT73

Pulling my weight
Joined
Aug 29, 2016
Messages
406
Reaction score
108
Location
Germany
yes that works, but not with newer firmware. And you are right, all streams change to mjpeg. Not a good solution.

I found another one, it seems to work with every cam i could test with:

Code:
http://username:password@ipcam/cgi-bin/snapshot.cgi
The Fritzbox has a parameter to reload the picture every x seconds. Because of the huge size its also not the best way. Lowering the main stream is not wanted.

Now i search a way to use second stream. Seems to be not so easy. But why should it not be possible.
 

TVT73

Pulling my weight
Joined
Aug 29, 2016
Messages
406
Reaction score
108
Location
Germany
I have got it, dammisch :p
Code:
http://ip/axis-cgi/mjpeg/video.cgi?subtype=1?user=[user]&loginpas=[passwd]
Only one thing i did wrong... i had chosen the wrong stream settings!
upload_2017-1-23_22-18-42.png

If you choose higher frame rates you get this bad picture, because it doesn´t fit with the bit rate. So a good choice is a frame rate of 3, bit rate 512 or 640.
BTW, a fritz fon uses dect connection, and therefore only 1-3 frame/s are possible. I will try it at home.

perfectly would it be with sub stream 2.... maybe i will find it.
upload_2017-1-23_22-27-1.png
 

TVT73

Pulling my weight
Joined
Aug 29, 2016
Messages
406
Reaction score
108
Location
Germany

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
Code:
nayr@dispatch:~$ wget http://ptz:ptz@192.168.42.28/cgi-bin/snapshot.cgi
--2017-01-26 17:32:04--  http://ptz:*password*@192.168.42.28/cgi-bin/snapshot.cgi
Connecting to 192.168.42.28:80... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Connecting to 192.168.42.28:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 435446 (425K) [image/jpeg]
Saving to: ‘snapshot.cgi’

snapshot.cgi        100%[=====================>] 425.24K  --.-KB/s   in 0.06s 

2017-01-26 17:32:04 (6.44 MB/s) - ‘snapshot.cgi’ saved [435446/435446]
on a camera much newer than yours
 

TVT73

Pulling my weight
Joined
Aug 29, 2016
Messages
406
Reaction score
108
Location
Germany
Hello Nayr,
with the newer firmware release the
Code:
http://user:passwd@camip/cgi-bin/snapshot.cgi
works again with hdw5231.
Unfortunately axis-cgi/mjpeg/video.cgi?subtype=1?user=[user]&loginpas=[passwd] is not possible and the main stream is too big. AVM specifies as maximum vga resolution. the picture is send by dect, and of course therefore the smaller the jpeg size the better.
Or is it a problem, that the file is named as snapshot.cgi and not snapshot.jpg ?
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
the header is reported as a jpeg, Length: 435446 (425K) [image/jpeg] so the extension should not matter.

sounds like you should consider upgrading this hardware; the 5231 dont even list MJPEG in its spec sheet and even the legacy MJPEG uses I have are at least capable of doing RTSP instead of being limited only to HTTP, thats very antiquated at this point and I doubt there doing any regression testing.. Ive found MJPEG broken entirely on other Dahuas and many other manufacturers dont even support it at all and have not for a while.

I presume these are wireless devices, you can get a tablet/phone app that can view cameras at full resolution and use a fraction of the bandwidth if you upgrade to h264/h265 capable hardware.
 

Crazykiller

Getting comfortable
Joined
Jan 30, 2017
Messages
544
Reaction score
317
Location
Germany
@TVT73 did you get any further with this? I'm also trying it with my fones for a couple of days without success... maybe it's caused by Digest auth and the Fritz fon only supports Basic auth, i suggest.
 

TVT73

Pulling my weight
Joined
Aug 29, 2016
Messages
406
Reaction score
108
Location
Germany
@Crazykiller,
this week I build up an agfeo tk system with a siedle doorcom dca612 and an hdw5231r-z(2.460.x.16.R with changes for auth and security) as doorcam. The agfeo system tel st45 is able to show the mjpeg stream as still picture when the door bell is used and inside of essuite (desktop cti solution) you can the the live stream.
I used following settings:
Sub Stream 2 with mjpeg D1 / 10 FPS VBR 5@ 1Mbit (not 100% for sure cam is offline at the moment)
Code:
Videostream-URL:
http://User:Passwd@192.168.178.202/cgi-bin/mjpg/video.cgi?channel=2
Still-Picture-URL:
http://User:Passwd@192.168.178.202/cgi-bin/snapshot.cgi
I didn´t tried it yet again with my fritzfon, but if it´s working with agfeo, than it should work with avm also.
 

Crazykiller

Getting comfortable
Joined
Jan 30, 2017
Messages
544
Reaction score
317
Location
Germany
I was hoping in the actual firmware is still a variable for user and pass. For me it looks like the Fritz fon could not login with basic auth. You don't see any login in the logs.
I already tried the snapshot.cgi, but i assume the image is too large for the Fritz fon, because the snapshot is always generated from the main stream.
While i was trying with the mjpg stream it sets the cam competely to mjpg. Will try a Little more. But I'm not connecting directly to the cam. It's connected to a PoE NVR, which uses almost the same API as the cams do.
I'll try a little more with this the next days... always had a picture on the fon before i changed my whole stuff to Dahua. Didn't assume this simple function wouldn't work any further.
 

TVT73

Pulling my weight
Joined
Aug 29, 2016
Messages
406
Reaction score
108
Location
Germany
With the last firmware release we can change the authorization from digest to basic.
But your Poe switch blocks direct access to the cam's. And the NVR API has some differences and config switch (profile) bugs...
So it's not really the same.
I am sure, my Agfeo installation has the main stream running at h265+ and the sub stream at mjpg. I use SmartPss on iMac's as local monitoring.
 

Jim_OS

Getting the hang of it
Joined
Jan 31, 2018
Messages
102
Reaction score
41
Location
Germany
I already tried the snapshot.cgi, but i assume the image is too large for the Fritz fon, because the snapshot is always generated from the main stream.
The same problem on SD49225T-HN with Firmware 2.6.x and FritzFon C4 Firmware 3.92

http://User:passwd@192.168.x.x/cgi-bin/snapshot.cgi = working on Browser and you can see the Main Stream
http://User:passwd@192.168.x.x/cgi-bin/snapshot.cgi?channel=1 = working on Browser but you see Main Stream
http://User:passwd@192.168.x.x/cgi-bin/snapshot.cgi?channel=2 = Error Bad Request!

Either the image size is the problem or the digist auth. I'll send an email to AVM and ask about the digist auth.

With the last firmware release we can change the authorization from digest to basic.
Hm - where? On my SD49225T-HN changing is only possible for RTSP.
RTSP_Digist.JPG
 
Top