Page 1 of 1

Api add monitor

Posted: Thu Apr 08, 2021 8:29 am
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

Re: Api add monitor

Posted: Thu Jun 24, 2021 10:45 pm
by bcurtis
Having same issue now, hoping maybe you found a solution?

Re: Api add monitor

Posted: Mon Apr 04, 2022 7:36 am
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"
        ]
    }
}

Re: Api add monitor

Posted: Mon Apr 04, 2022 12:45 pm
by bunnyman
A possible solution is given here. It involves modifying the Php code.

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