python or http api access to the live stream of IP4M-1051B

Have some questions or having issues with your IP Camera(s), Post them here for the mods and other users to assist you with.
Post Reply
shaikaplan
Posts: 2
Joined: Tue Dec 01, 2020 8:07 pm

python or http api access to the live stream of IP4M-1051B

Post by shaikaplan »

I am trying to use the python api or the http api to access the live stream of my ip camera IP4M-1051B
The camera works well via browser and python for snapshot and ptz movements
However the livestream url does not work.
for the following python command :
camera.realtime_stream(channel=1,path_file=r"..\data\vid1.mp4")

I get the following error:
<AMC047D7_B28B77:AMC047D74584B28B77> Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.1.204:80/cgi-bin/realmon ... &subtype=0',)

similarly the following also fail:
camera.mjpg_stream(channelno=1,typeno=0)

What may be the problem?
What is the correct http url that return a stream that I can save into a file on my PC (Win10)?

Thanks for any help
User avatar
longedge
Site Admin
Posts: 584
Joined: Fri Mar 31, 2017 9:34 am

Re: python or http api access to the live stream of IP4M-1051B

Post by longedge »

Hello and welcome to the forum.

To access the camera video stream I use -

rtsp://admin:[email protected]:554/cam/realmonitor?channel=1&subtype=0

That works well for me in an app that I built for myself (don't know Python my environment is LUA based but just a 'pre-cooked' gui).

p.s. - For snapshots I call - http://admin:[email protected]/cg ... apshot.cgi

p.p.s. - One of my cameras, in particular, is very slow to respond and times out a lot but I've found that if I keep trying, it eventually 'wakes up'. To keep this problem to a minimum I have my cameras set to automatically re-boot every day because the camera is most responsive when it has just re-started.

p.p.p.s - Revo2Maxx provided a link to the current sdk in this post - https://amcrest.com/forum/viewtopic.php ... sdk#p34188
My AMCREST Cameras:-
2 x IP3M-941B firmware V2.620.00AC00.3.R, Build Date: 2019-12-18
1 x IP2M-841B firmware V2.420.AC00.18.R, Build Date: 2019-08-03
jack7
Posts: 904
Joined: Tue May 29, 2018 7:46 pm

Re: python or http api access to the live stream of IP4M-1051B

Post by jack7 »

As Longedge mentioned:
Example from the Amcrest API pdf:
rtsp://admin:[email protected]:554/cam/realmonitor?channel=1&subtype=1
Subtype 0 is mainstream, 1 is substream.

You can't put it in browser. Put it in VLC or some other video player to receive and display stream.
Post Reply