Community
Get all camera media always returns the same image
Hello,
I noticed that the "Get all camera media" endpoint always returns the exact same image URLs for frontFacing and for driverFacing respectively within a response, even though the captureTime timestamps change. The URLs are identical. Modifying the endTime (not the startTime) may change the image returned.
I think there's something wrong on your end. Potentially, the image corresponding to the acquired image closest to the endTime parameter is the one returned for all timestamp within the startTime-endTime timespan.
Sample:
```javascript
{
"captureTime": "2021-02-22T17:18:04.187Z",
"url": "https://s3.eu.samsara.com/samsara-eu-dashcam-videos/redacted
}
{
"captureTime": "2021-02-22T17:23:05.186Z",
"url": "https://s3.eu.samsara.com/samsara-eu-dashcam-videos/redacted
}
{
"captureTime": "2021-02-22T17:28:05.187Z",
"url": "https://s3.eu.samsara.com/samsara-eu-dashcam-videos/redacted
}
{
"captureTime": "2021-02-22T17:33:05.187Z",
"url": "https://s3.eu.samsara.com/samsara-eu-dashcam-videos/redacted
}
{
"captureTime": "2021-02-22T17:33:59.187Z",
"url": "https://s3.eu.samsara.com/samsara-eu-dashcam-videos/redacted
}
```
This output is obtained from the following command line:
```shell
curl --location --request GET 'https://api.eu.samsara.com/fleet/vehicles/cameras/media/history?startTime=2021-02-22T00:00:00.000Z&endTime=2021-02-22T23:59:59.999Z' \
--header 'Authorization: Bearer REDACTED' | jq -r '.data[0].cameras[0].images[] | {captureTime: .captureTime, url: .imageData[] | select(.cameraView == "frontFacing") | .url}'
```
Note: all redacted URLs are identical, which is the issue explained above. Changing the endTime may yield another image
```shell
curl --location --request GET 'https://api.eu.samsara.com/fleet/vehicles/cameras/media/history?startTime=2021-02-22T00:00:00.000Z&endTime=2021-02-22T13:59:59.999Z' \
--header 'Authorization: Bearer REDACTED' | jq -r '.data[0].cameras[0].images[] | {captureTime: .captureTime, url: .imageData[] | select(.cameraView == "frontFacing") | .url}'
```
Additional question: is there a way to request the immediate capture of a new snapshot from the dashcam (front and driver)? This is very important for our use case.
If not, what is the capture frequency? Looking at the captureTime timestamps, it's irregular: 5 minutes seems to be the baseline frequency but sometimes it's more frequent. Can snapshots be automatically be taken when engine is turned off?
Thank you
Posted by Guillem Mazarico over 2 years ago
camera parameter issue
Hi I'm currently trying to use
https://api.samsara.com/fleet/vehicles/cameras/media/history
but having issues with startTime and endTime parameters
I set it as close as I can but it says missing from query string.
python 3.x
camera = 'https://api.samsara.com/fleet/vehicles/cameras/media/history'
headers = {
"Accept": "application/json",
"Authorization": "Bearer <<token>>",
"startTime": "2021-02-14T00:00:00Z",
"endTime": "2021-02-15T00:00:00Z"
}
response = requests.request("GET", camera, headers=headers)
print(response.text)
result:
<class 'str'>
2021-02-16T17:05:09Z 2021-02-16T17:05:09Z
{"message":"\"startTime\" is missing from query string; \"endTime\" is missing from query string","requestId":"74dcdd32-6e4ae656"}
Posted by Gujin over 2 years ago
Samsara camera live stream media (video) to a third party processor
Can video content from Samsara cameras be diverted (streamed in real-time) to a third party onboard processor for interpretation? The use case I am looking at is a POC that would run in parallel to the verticalized Samsara configuration (camera-gateway-cloud).
As a follow-up question, is Samsara considering allowing third-party AI/algorithms to run on their in-vehicle (vs. cloud) tech stack?
Posted by David Braunstein over 2 years ago