Author Topic: Web API control: /control/startPlayback results in 400 error  (Read 11403 times)

Kristian

  • Newbie
  • *
  • Posts: 2
    • View Profile
Web API control: /control/startPlayback results in 400 error
« on: September 11, 2020, 04:16:34 AM »
Hi!

I'm doing some testing with Node.js to remote control the camera via a custom web interface.

Here's part of my Node.js code, which is inside a try/catch block inside an async function.
The recording works fine, but the startPlayback command gives me a 400 error:
https://gist.github.com/kristianpedersen/107a127251698d44e7dad08c265f72dd

I tried reading the source code of the Chronos web control panel, and it seems like the play button sends two different calls to "/control/startPlayback", changing the framerate to 60 or 0, in order to play and pause.

Is there some kind of state that needs to be toggled before I can play back the last recorded video?
Why does the Chronos web interface work, and not my Node.js code?
« Last Edit: September 11, 2020, 05:47:12 AM by Kristian »

sanjay

  • Krontech
  • Newbie
  • *****
  • Posts: 38
  • Krontech
    • View Profile
Re: Web API control: /control/startPlayback results in 400 error
« Reply #1 on: September 11, 2020, 02:39:28 PM »
Hi Kristian,

Are you able to get the startPlayback to work if you use a curl command? On my camera here in the office, the below command will successfully put the video pipeline into playback mode and
advance through frames as expected:

curl --header "Content-Type: application/json" --request POST --data '{"framerate":60, "position":0}' http://192.168.1.118/control/startPlayback


I took some time to try out the axios client in some test scripts as well and had trouble with post requests whenever they needed extra parameters, so I think something is missing there.

Kristian

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Web API control: /control/startPlayback results in 400 error
« Reply #2 on: September 14, 2020, 02:35:12 AM »
Thanks, Sanjay! The curl command works perfectly.

I'm having some issues if I disable auto save though:

Recording works fine, but it doesn't play back unless I've hit hit "play" on the camera to enter the playback window.

Is there another command available, so I can switch into this mode and then start playback?