Quick StartΒΆ

Most of the analytics currently available on VideoAI.net have the following workflow.

  • You submit a video to the analytics service. When the video is uploaded a job is scheduled.
$ curl -L -F video=@video.avi http://api.videoai.net/some_analytic
  • You get an immediate response, a JSON formatted task object.
HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 217
Server: Werkzeug/0.10.4 Python/2.7.6
Date: Mon, 14 Sep 2015 14:37:42 GMT
{
  "status": "success",
  "task": {
        "analytic": "some_analytic",
        "complete": false,
        "job_id": "pCeKk22tNsMSnZbUyZ4VWR",
        "message": "In progress.",
        "start_time": "Mon, 14 Sep 2015 14:37:41 GMT"
  }
}
  • At any time you can check the status of the job,
$ curl -L http://api.videoai.net/some_analytic/pCeKk22tNsMSnZbUyZ4VWR
  • When the task is complete, the JSON response is filled out with all the job details. For example,
HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 693
Server: Werkzeug/0.10.4 Python/2.7.6
Date: Mon, 14 Sep 2015 14:37:51 GMT
{
  "status": "success",
  "task": {
        "analytic": "some_analytic",
        "complete": true,
        "finish_time": "Mon, 14 Sep 2015 14:37:50 GMT",
        "frames": 669,
        "frames_processed": 668,
        "input_video": "vegetation.avi",
        "job_id": "pCeKk22tNsMSnZbUyZ4VWR",
        "message": "SafeZone.2D task complete.",
        "resolution": "352x200@12.0fps",
        "results_video": "https://api.videoai.net/results/257/pCeKk22tNsMSnZbUyZ4VWR/some_analytic_pCeKk22tNsMSnZbUyZ4VWR.avi",
        "results_xml": "https://api.videoai.net/results/257/pCeKk22tNsMSnZbUyZ4VWR/some_analytic_pCeKk22tNsMSnZbUyZ4VWR.xml",
        "start_frame": 0,
        "start_time": "Mon, 14 Sep 2015 14:37:41 GMT",
        "success": true
  }
}
  • You can then optionally download some extra results of your analytics job (if supported by the analytic)
$ wget https://api.videoai.net/results/257/pCeKk22tNsMSnZbUyZ4VWR/some_analytic_pCeKk22tNsMSnZbUyZ4VWR.avi
$ wget https://api.videoai.net/results/257/pCeKk22tNsMSnZbUyZ4VWR/some_analytic_pCeKk22tNsMSnZbUyZ4VWR.xml

Some important notes,

  • The requests require the authentication header. This has been left out for brevity.
  • Depending on the analytics the structure and information of the task will be different.
  • The results are only guaranteed to live on the server for 7 days after the job has finished processing.