themactep / thingino-firmware

Open-source firmware for Ingenic SoC IP cameras
https://thingino.com
MIT License
79 stars 28 forks source link

ONVIF PTZ improvements #99

Closed pauln closed 1 month ago

pauln commented 1 month ago

Adds getposition command and redirects move* output to /dev/null to prevent their output being injected as HTTP headers in ONVIF responses.

themactep commented 1 month ago

I like the idea but maybe removing motors output under -v flag would be a better solution to silence the app? @gtxaspec please chime in.

pauln commented 1 month ago

Silencing the motors output (either by default or via a new flag - maybe -q for "quiet") would definitely be tidier - and if that's happening, adding a new flag to get the position in simple x,y format would save us from using sed to extract them from the JSON output. This PR was just the result of a quick attempt at enabling PTZ in Frigate by adjusting onvif.conf - if we can improve motors to make this cleaner, I'm definitely in favour of that.

pauln commented 1 month ago

I've popped in a PR for the motors tool to add a -q flag to suppress output and a -p flag to get the plain x,y position output. If that gets merged (or an alternative), I'll update this PR to use the new commands.

gtxaspec commented 1 month ago

@pauln i merged your pr in the motors repo, i think you can refactor this a bit. check the latest commits i pushed also regarding onvif.

pauln commented 1 month ago

@gtxaspec Since you've already added get_position, I've rebased and replaced the redirection to /dev/null with the new -q option on the move commands.