Setting OutputCodec via api

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
BiloxiGeek
Posts: 271
Joined: Tue Feb 11, 2014 2:04 pm

Setting OutputCodec via api

Post by BiloxiGeek »

I've run into a problem creating a monitor with the api.

Running this:

Code: Select all

curl -k -XPOST https://localhost/zm/api/monitors.json -d "Monitor[Id]=101&Monitor[Name]=Front&Monitor[ServerId]=0&Monitor[StorageId]=0&Monitor[Type]=Ffmpeg&Monitor[Function]=Modect&Monitor[Enabled]=1&Monitor[DecodingEnabled]=1&Monitor[Method]=rtpRtsp&Monitor[Path]=rtsp://10.10.100.1/0"
(I've tried a much larger api call with other settings, this one was just for testing and to save some typing.)

Results in:

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"]}}
I've tried setting OutputCodec to h264 and get a different error:

Code: Select all

{"success":false,"data":{"name":"An Internal Error Has Occurred.","message":"An Internal Error Has Occurred.","url":"\/zm\/api\/monitors.json","exception":{"class":"PDOException","code":"22007","message":"SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: 'h264' for column `zm`.`Monitors`.`OutputCodec` at row 1"}}}
So setting h264 is an invalid date time? That just seems awfully weird.

Added: I don't see anywhere in the web UI when defining a monitor to set the OutputCodec.
Post Reply