Api add monitor

Previous development branch now released as 1.36
Locked
Cramac1
Posts: 111
Joined: Wed Aug 29, 2018 11:29 am

Api add monitor

Post by Cramac1 »

Hello.
add monitor:

Code: Select all

	$data="Monitor[Name]=dmf-".$tmp."&Monitor[Function]=Record&Monitor[Type]=Ffmpeg&Monitor[ServerId]=4&Monitor[StorageId]=2&Monitor[Path]=rtsp://".$list[0]["login"].":".$list[0]["password"]."@".$list[0]["ip"]."/Streaming/channels/1&Monitor[Method]=Tcp&Monitor[Colours]=4&Monitor[Width]=1920&Monitor[Height]=1080&Monitor[SaveJPEGs]=0&Monitor[VideoWriter]=2";
	$result = CallAPIzm($zmurl,'POST', 'zm/api/monitors.json?token='.$token, $data);

but I get the error:

Code: Select all

{ ["message"]=> array(1) { ["OutputCodec"]=> array(2) { [0]=> string(69) "Please choose one of the following values : H264, Mjpeg, Mpeg1, Mpeg2" [1]=> string(69) "Please choose one of the following values : H264, Mjpeg, Mpeg1, Mpeg2" } } } 
before updates, it worked, now I will not select a value for the field
bcurtis
Posts: 1
Joined: Thu Jun 24, 2021 10:43 pm

Re: Api add monitor

Post by bcurtis »

Having same issue now, hoping maybe you found a solution?
bunnyman
Posts: 2
Joined: Mon Apr 04, 2022 7:13 am

Re: Api add monitor

Post by bunnyman »

I have the same issue. Getting following error:

Code: Select all

{
    "message": {
        "OutputCodec": [
            "Please choose one of the following values : H264, Mjpeg, Mpeg1, Mpeg2",
            "Please choose one of the following values : H264, Mjpeg, Mpeg1, Mpeg2"
        ]
    }
}
bunnyman
Posts: 2
Joined: Mon Apr 04, 2022 7:13 am

Re: Api add monitor

Post by bunnyman »

A possible solution is given here. It involves modifying the Php code.

https://github.com/ZoneMinder/zoneminder/issues/3341
Locked