Reputation: 11
I am integrating the HikVision DeepView camera via ISAPI and I encountered a problem, I did everything according to the documentation but I failed with the endpoint "ISAPI/Event/notification/alertStream"
I tried various methods and I managed to do it only with curl after browsing all the forums :), maybe not completely because when using curl it prints the result on the screen and I don't really know how to take it over by setting CURLOPT_RETURNTRANSFER to true it does not shorten the result after setting it to false it prints to the screen but I don't really know how to go about it.
Below is a simple curl call that allows me to download activated alarms
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://{}/ISAPI/Event/notification/alertStream');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_USERPWD, '{}}' . ':' . '{}}');
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);
return $response;
Script invoked in command symfony.
I am making a huge request for help :)
Upvotes: 0
Views: 1384
Reputation: 357
The notification API streams all notifications until you close the connection, this is why it's hard to use via curl.
Try this code instead: https://gist.github.com/ethaniel/72dae721ff770b7e1dcb0101589ed361
Upvotes: 0
Reputation: 41
this is the alertstream protocol
the --boundary represents the binary image data
Upvotes: 0
Reputation: 11
I managed to save the data to the file, but from what I can see there is also binary data, an image and it will be difficult to extract anything from it
Upvotes: 0