I have invested several days to all kinds of tests and trials, unsuccessfully, so must resort to asking the greater forum knowledge and experience, hopefully.
This should be a relatively trivial task. Just get a MJPEG stream from the NVR (in my case, a NV4108E) straight into a browser tab, using HTTP (not RTSP).
I have fairly thoroughly digested the latest 2020 published version of the Amcrest HTTP Protocol API Specifications. I am also testing in parallel acquiring the video stream on VLC.
On VLC:
Using the "Stream" function. RTSP works easily and flawlessly. HTTP doesn't. The initial authentication pop-up comes up and after entering my credentials, it shows a blank screen.
On either Chrome or Edge in IE-compatibility mode:
(RTSP is N/A, of course). Using the proper "Get mjpg stream" string, both browsers show the same response, pop-up the authentication box, the go into a blank screen, with a little gray square box in the center of the screen. This makes me very suspicious I may be doing something wrong somewhere. May be the NVR config somewhere.
Would anyone know what I may be missing, if anything?
MJEPG stream from NVR using HTTP
Re: MJEPG stream from NVR using HTTP
Sorry dumb question I know but what NVR4108E are you using?
Normal,
HS
or A2
Then if you were able to display what your http command is others could test it for the one your using and see what might be missing
Normal,
HS
or A2
Then if you were able to display what your http command is others could test it for the one your using and see what might be missing
Be Safe.
Re: MJEPG stream from NVR using HTTP
Not all Amcrest camera support MJPG, and only with substream. Use camera Web UI to see if your camera substream supports MJPG.
This command worked fine for me with Chrome, NO NVR, and IP4M-1026 which supports MJPG.
This command worked fine for me with Chrome, NO NVR, and IP4M-1026 which supports MJPG.
Code: Select all
http://192.168.0.136/cgi-bin/mjpg/video.cgi?channel=1&subtype=1
Re: MJEPG stream from NVR using HTTP
Sure, no problem. I was wondering whether somebody might have already found a working recipe for HTTP streaming. May be not.
Anyhow. Version is the "normal" I guess, purchased about 4-5 years ago.
Get HTTP stream command is:
http://<ipaddressNVR>/cgi-bin/mjpg/video.cgi?channel=1&subtype=0
I also tried a previous iteration of such command, from the older 1.51 API doc, but that doesn't work at all:
http://<ipaddressNVR>/cgi-bin/realmonitor.cgi?getStream&channel=1&subtype=0
Anyhow. Version is the "normal" I guess, purchased about 4-5 years ago.
Get HTTP stream command is:
http://<ipaddressNVR>/cgi-bin/mjpg/video.cgi?channel=1&subtype=0
I also tried a previous iteration of such command, from the older 1.51 API doc, but that doesn't work at all:
http://<ipaddressNVR>/cgi-bin/realmonitor.cgi?getStream&channel=1&subtype=0
Re: MJEPG stream from NVR using HTTP
Well, question is whether the NVR can stream over HTTP. I have 4 PoE hardwired, two wireless, and a Doorbell first-gen all perfectly working with and feeding into the NVR. Ideal to harmonize all access through its single ip, and just request the desired channel via the command. As opposed to having to deal with seven separate ip's and 4 of them within the NVR's subnet.
By the way, all the six cameras (not sure about the ad110 yet) have MJPEG as a codex option. However, I'm not even sure that is a factor of concern. But yes, all have the codex option anyway.
Re: MJEPG stream from NVR using HTTP
your best bet if your Channel your trying to access don't offer MJPG then you will get a little box. So I do have some cameras on my NVR's that offer it so as you can see from the screen shot my Samsung has that for main stream hate to say very spendy camera from years past has one type of main and not even useable most times so I full time record the sub stream that is h.264 30fps.. I mean it has 10 streams just 1-3 can't be changed positions wise lol Anyway so that is only one that would work on that NVR I have some others on other NVR's however that feature isn't all that great to stream a live view best to RSTP...
Be Safe.
-
- Posts: 26
- Joined: Mon Jan 13, 2025 3:04 pm
Re: MJEPG stream from NVR using HTTP
Hi All,
So I have the : Amcrest 4K Outdoor Security IP Turret PoE Camera IP67 IP8M-T2599EW-AI-V3
The HTTP Specification Documents allude to getting the Main MJPG stream :
All I can get is this MJPEG small stream:
http://192.168.0.109/cgi-bin/mjpg/video ... &subtype=1
Are you saying that for the MainFormat / main stream, you can't set that to a MJPG with something like this:
http://192.168.1.108/cgi-bin/configMana ... ].MainForm
at[0].Video.Compression=MJPEG
Are you saying that all I can get out of a camera like mine is a H.264/H.265 and not with HTTP, only with RSTP??!?
What good is that, it makes displaying in a browser darn near impossible with a plugin or something like this:
https://github.com/samirkumardas/jmuxer
So I have the : Amcrest 4K Outdoor Security IP Turret PoE Camera IP67 IP8M-T2599EW-AI-V3
The HTTP Specification Documents allude to getting the Main MJPG stream :
This did not work for me.4.1.4 Get MJPG Stream
Get a video stream encoded by mjpg ( motion jpeg ).
Request URL http://<server>/cgi-bin/mjpg/video.cgi
HTTP_API_V3.26 for Amcrest
General APIs 35
Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
channel int R The video channel index which starts from 1 1
subtype int R
The stream type, It can be the following value:
0-Main Stream
1-Extra Stream 1
2-Extra Stream 2
0
Request Example
http://192.168.1.108/cgi-bin/mjpg/video ... &subtype=0
All I can get is this MJPEG small stream:
http://192.168.0.109/cgi-bin/mjpg/video ... &subtype=1
Are you saying that for the MainFormat / main stream, you can't set that to a MJPG with something like this:
http://192.168.1.108/cgi-bin/configMana ... ].MainForm
at[0].Video.Compression=MJPEG
Are you saying that all I can get out of a camera like mine is a H.264/H.265 and not with HTTP, only with RSTP??!?
What good is that, it makes displaying in a browser darn near impossible with a plugin or something like this:
https://github.com/samirkumardas/jmuxer
Re: MJEPG stream from NVR using HTTP
Well I can't say that you can't do anything.. What I was saying is that there might be some limit on what one can do.. MJPEG is a low quality image no matter what stream you happen to take it form..
But what I will say is that if you want a MJPEG format setup you will need to have a camera that supports that format.. Now some of the newer higher quality cameras have different encoding Tech and maybe you can get it from Main.. 1 problem however. If you setup your HD camera to a lower quality stream encoding format then you will not have a High quality feed going to anything else. It is one way or the other.. What I have said before is that normally you can setup some cameras with MJPEG on the Sub Channel and this way all other events captured to the camera are not low quality MJPEG format..
Please note that looking at my cameras in the pictures first ones will be of my TD2685EW-AI camera only offered in Sub Channel, Then looked in my 2779EW-AI that is also a 8mp ai camera and again it only offers it in the Sub Channels and then the one that I was able to find in Main channel is a 2mp PTZ camera from years gone last FW was like 2017 even though the webUI says 2015 so very old browser tech and it does offer in the Main and Sub. But again by changing it just for some images through out the day any HD footage of real events will also be recorded in lower quality MJPEG format as well.. On top of all that no images will come at that format without first going to the WebUI and setting up your camera to support that format.. Again it will not do both using H.265, or 264 for normal captures and your images at the lower quality format of MJPEG at the same time on the same channel either main or sub if it is supported it must be changed to that format..
But what I will say is that if you want a MJPEG format setup you will need to have a camera that supports that format.. Now some of the newer higher quality cameras have different encoding Tech and maybe you can get it from Main.. 1 problem however. If you setup your HD camera to a lower quality stream encoding format then you will not have a High quality feed going to anything else. It is one way or the other.. What I have said before is that normally you can setup some cameras with MJPEG on the Sub Channel and this way all other events captured to the camera are not low quality MJPEG format..
Please note that looking at my cameras in the pictures first ones will be of my TD2685EW-AI camera only offered in Sub Channel, Then looked in my 2779EW-AI that is also a 8mp ai camera and again it only offers it in the Sub Channels and then the one that I was able to find in Main channel is a 2mp PTZ camera from years gone last FW was like 2017 even though the webUI says 2015 so very old browser tech and it does offer in the Main and Sub. But again by changing it just for some images through out the day any HD footage of real events will also be recorded in lower quality MJPEG format as well.. On top of all that no images will come at that format without first going to the WebUI and setting up your camera to support that format.. Again it will not do both using H.265, or 264 for normal captures and your images at the lower quality format of MJPEG at the same time on the same channel either main or sub if it is supported it must be changed to that format..
Be Safe.
-
- Posts: 26
- Joined: Mon Jan 13, 2025 3:04 pm
Re: MJEPG stream from NVR using HTTP
Thx Revo for responding.
Ok, was able to get around the limitations of the Camera and lock onto the RSTP Feed with the Following Python Code. This should give me the ability to do frame over frame processing in Near Real time on my local GPU.
I would imagine for Motion Detection / Object Detection / AI Recognition that the Cameras have to scale down their frames considerably and pass it to a Cloud solution. This will hog internet bandwidth, also impact detection distance. I wanted to use these cameras and put it through a high powered GPU locally on my 2.5GB Lan to watch a 5 acre property 24x7 rather than just have these cameras watch a driveway or breezeway.
The Image quality is Outstanding in both Night and Day Vision, Very Very Impressed with that. The HTTP API ...really needed a lot more Q/A and Critique. Looks like they just went with first prototype and stayed with it for backward compatibility.
Ok, was able to get around the limitations of the Camera and lock onto the RSTP Feed with the Following Python Code. This should give me the ability to do frame over frame processing in Near Real time on my local GPU.
Code: Select all
import cv2
cap = cv2.VideoCapture("rtsp://admin:[email protected]:554/cam/realmonitor?channel=1&subtype=0")
while(cap.isOpened()):
ret, frame = cap.read()
cv2.imshow('frame', frame)
if cv2.waitKey(20) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
I would imagine for Motion Detection / Object Detection / AI Recognition that the Cameras have to scale down their frames considerably and pass it to a Cloud solution. This will hog internet bandwidth, also impact detection distance. I wanted to use these cameras and put it through a high powered GPU locally on my 2.5GB Lan to watch a 5 acre property 24x7 rather than just have these cameras watch a driveway or breezeway.
The Image quality is Outstanding in both Night and Day Vision, Very Very Impressed with that. The HTTP API ...really needed a lot more Q/A and Critique. Looks like they just went with first prototype and stayed with it for backward compatibility.