SiteTrax.io API - Input (Video)
SiteTrax.io API - Input (Video)
Getting Started
The SiteTrax.io backend requires a centralized data storage to transfer data to and from it. Currently, Amazon AWS S3 buckets are supported as the recommended data store. If needed, the bucket information and access keys can be provided by SiteTrax.io or your organization is welcome to set up their own S3 buckets. Please submit a support ticket to request a bucket and access keys to process videos.
For instructions on setting up a test environment, please see the Test Development Environment - Setup SiteTrax Test API and JSON article.
Overview
The SiteTrax.io backend analyzes video stored in an Amazon S3 bucket and outputs that data to any REST API server.
Reference: https://docs.google.com/drawings/d/1ZwDE18DMtbIDPIujX_M61jRm2SvanIolZJ7RsnY4XW0/edit
Step #1: Upload Video (Push) - See Input - Video Specifications below for more details
Step #2: REST API Server (Push)
After the video is uploaded in Step #1 above, the SiteTrax.io Backend will analyze the video and push the data analyzed to any REST API server via the SiteTrax.io Router. See Output - REST API page more information.
NOTE: Make sure to request API Server access via the link in the Overview section above.
Input - Video Specifications
The files that should be uploaded in {bucket_name}/notprocessed folder. The maximum recommended length of a video is 1 minute.
SiteTrax.io Camera Types
SiteTrax.io can capture data from many different types of cameras including Android and basic security cameras. For implementation purposes, we recommend:
GPS Encoding
Below is an example of embedded subtitles in SRT format.
1 00:00:00,000 --> 00:00:00,150 36.8626459 -76.2314164 2 00:00:00,150 --> 00:00:00,300 36.8626459 -76.2314164 3 00:00:00,300 --> 00:00:00,450 36.8626459 -76.2314164 . . .
Video creation time should be present in both video stream and subtitle stream. In addition to this, creation time should also be present in file metadata. Video should be in mp4 format only. Below in an example of metadata as ffmpeg output.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2_20211018T042608717Z_s00.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 2021-10-18T16:26:08.000000Z
encoder : Lavf58.67.100
Duration: 00:00:14.55, start: 0.000000, bitrate: 29921 kb/s
Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuvj420p(pc, smpte170m/bt470bg/smpte170m), 1920x1080, 33017 kb/s, SAR 1:1 DAR 16:9, 30.04 fps, 30 tbr, 90k tbn (default)
Metadata:
creation_time : 2021-10-18T16:26:08.000000Z
handler_name : VideoHandle
vendor_id : [0][0][0][0]
Side data:
displaymatrix: rotation of -90.00 degrees
Stream #0:1(und): Subtitle: mov_text (tx3g / 0x67337874), 1 kb/s (default)
Metadata:
creation_time : 2021-10-18T16:26:08.000000Z
handler_name : SubtitleHandler
Sample videos can be found here.
Video Upload
Once a video is generated, it can be uploaded to your designated bucket. Your SiteTrax.io representative will give you a URL specific to your project. A POST request with the json body below (replace <video_name> with the file name of the video you are uploading) will return a presigned URL to which the video should be uploaded. This URL will be active for 300 seconds.
{
"video": "<video_name.mp4>",
"method": "put_object"
}
Once you have the presigned URL, uploading the video to the s3 bucket can be done by following these steps.
https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-presigned-url.html
Note that this method can also be used to download a video that you have previously uploaded by changing the method to "get_object".
Once the video upload is complete, SiteTrax.io backend will start processing the video. The processing time is proportional to the number of trackable assets in the video.
If records from a video do not show up please check our status page or if all services are up then please file a support ticket at our support page.