Skip to end of metadata
Go to start of metadata

These are the main flows supported by our API:

1- Video upload and tagging

This user flow allow users to upload a video and automatically tag it

API CALLS

StepAPI CallDescription
Video Upload

/cv_backend/api/video_upload (POST)

Form Param

Param value

file

Video file
Upload a video that you wish to tag. Use the id that is returned on the JSON to the subsequent calls.
Check if video upload is done/cv_backend/api/video_upload/{id} (GET)

Check whether the current video has been processed or not.

Get tags for the video and for the scenes/cv_backend/api/video_upload/{id}/video (GET)

Once the video is processed (percentage = 100), the tags for both the video and the scenes can be retrieved on the JSON response, like the one below:

 {...
	"labels": [
          {
            "id": 6708,
            "name": "food",
            "score": 1.6879953063875788
          },
          {
            "id": 6709,
            "name": "food & drink",
            "score": 1
          },
          {
            "id": 6710,
            "name": "pink",
            "score": 0.94833088
          },
          {
            "id": 6711,
            "name": "dessert",
            "score": 0.8734581815625
          }],
	...}

2- Video upload and interstitial insertion

This user flow allow users to upload a video and insert a interstitial on the natural breaks of the content.

API CALLS

StepAPI CallDescription
Video Upload

/cv_backend/api/video_upload (POST)

Form Param

Param value

file

Video file
Upload a video that you wish to insert a interstitial.Use the id that is returned on the JSON to the subsequent calls.
Check if video upload is done/cv_backend/api/video_upload/{id} (GET)

Check whether the current video has been processed or not.

Get the video information/cv_backend/api/video_upload/{id}/video (GET)

Get the video information together with the scene breaks score. Those scores will be a list under the tag "scores". Example:

{... 
"scores": [
      {
        "frame": 120, // frame when the break is
        "score": 1, // natural break score (highest scores are better breaks)
        "time": 4.8 // time in seconds when the break is
      },
	  {
        "frame": 240,
        "score": 0.5,
        "time": 9.6
      }
    ],
...}
Bind an interstitial media file to the content

cv_backend/api/video_upload/{videoUploadId}/midroll (POST)

Form Param

Param value

midroll

Interstitial/Midroll video file
Upload the media file that will be the interstitial content
Generate the combined video

cv_backend/api/video_upload/{videoUploadId}/midroll/generate (POST)

A JSON with the frame where the interstitial should be generated must be sent inside the request body. On the example below, we use the frame 120 (same as the first score from the previous call). This is the JSON of the request body:

{"frame":120}
Generate the final video with an interstitial inside it.
Check if final video is done + get final url/cv_backend/api/video_upload/{id}  (GET)Check wether the video is done and, if it is completed, get the final video url from the VideoUpload entity.

3- Video upload and logo embedding on a surface.

This user flow allows for a media file (image, gif or video) to be inserted inside a automatic detected surface in a video. IMPORTANT: Right now this flow only works for static scenes (scenes recorded using a static camera on a tripod, without camera movement). For moving scenes, the results can be unpredictable. 

API CALLS

StepAPI CallDescription
Video Upload

/cv_backend/api/video_upload (POST)

Form Param

Param value

file

Video file
Upload a video that you wish to embed the brand art. Use the id that is returned on the JSON to the subsequent calls.
Check if video upload is done/cv_backend/api/video_upload/{id} (GET)Check wether the current video has been processed or not.
See List of Scenes

/cv_backend/api/video_upload/{id}/video

(GET)

Once the video is processed, check the scenes that our algorithm detected and that are fit for hosting brand art.
See List of Surfaces

/cv_backend/api/video_upload/{id}/video/scene/{sceneId} (GET)

Once a scene is selected, check the surfaces detected inside that scene
Bind an logo media file to a given scene

/cv_backend/api/video_upload/{videoUploadId}/video/scene/{sceneId}/logo (POST)

Form Param

Param value

art

Media file to be embedded
Binds a media file to a given scene for generating the final video
Generate the final video for a surface using the media file from the previous call

/cv_backend/api/video_upload/{videoUploadId}/video/custom (POST)

A JSON with the information about the placement, such as the example below, must be in the request body:

{"surfaceList":[{"sceneId":4655,"surface":{
"id":36380,"x":297.2903225806451,
"y":720.6883365200764,"w":844.3870967741935,"h":342.791586998088,
"p1":null,"p2":null,"p3":null,"p4":null,"area":52731},
"warp":false,"noShadow":false,"noBlend":false,
"facebookSafe":false}]}
Generate the final video using the coordinates passed on the JSON and the media file from the previous request.
Check if logo embedding is done + get final url/cv_backend/api/video_upload/{id}  (GET)Check wether the logo embedding is done and, if it is completed, get the final video url from the VideoUpload entity.

4- Overlay insertion

This user flow allows for a media file (image, gif or video) to be inserted inside a coordinate of the video as a overlay.

API CALLS

StepAPI CallDescription
Video Upload

/cv_backend/api/video_upload (POST)

Form Param

Param value

file

Video file
Upload a video that you wish to embed the brand art. Use the id that is returned on the JSON to the subsequent calls.
Check if video upload is done/cv_backend/api/video_upload/{id} (GET)Check wether the current video has been processed or not.
Upload media asset to library

/cv_backend/api/logos (POST)

Form Param

Param value

art

Media file to be uploaded

Meta-data about the media asset library, including id of the logos to be used in subsequent requests. The most recent uploaded logo will be the first in list:

{"error":null,"responseBody":[
{"id":484,"name":"klondike-logo.jpg","dateUploaded":1493647892185,"path":"http://s3.amazonaws.com/brohan/brunno/logos/stream2file1618265434626480490.jpg","thumbnailPath":"http://s3.amazonaws.com/brohan/brunno/logos/stream2file1618265434626480490.jpg"},{"id":382,"name":"stream2file742288568307428357.jpg","dateUploaded":1493126412830,"path":"http://s3.amazonaws.com/brohan/brunno/logos/stream2file7533403717266488896.jpg","thumbnailPath":"http://s3.amazonaws.com/brohan/brunno/logos/stream2file7533403717266488896.jpg"},{"id":377,"name":"giphy (71).gif","dateUploaded":1493052883389,"path":"http://s3.amazonaws.com/brohan/brunno/logos/stream2file8267622065328543321.gif","thumbnailPath":"http://s3.amazonaws.com/brohan/brunno/logos/stream2file8267622065328543321.gif"},{"id":256,"name":"uru.gif","dateUploaded":1489866443690,"path":"http://s3.amazonaws.com/brohan/brunno/logos/stream2file3007761349944365373.gif","thumbnailPath":"http://s3.amazonaws.com/brohan/brunno/logos/stream2file3007761349944365373.gif"},{"id":226,"name":"header-logo.png","dateUploaded":1488817602468,"path":"http://s3.amazonaws.com/brohan/brunno/logos/stream2file513496362857469646.png","thumbnailPath":"http://s3.amazonaws.com/brohan/brunno/logos/stream2file513496362857469646.png"},{"id":190,"name":"stream2file110216808001379524 (1).gif","dateUploaded":1487258877433,"path":"http://s3.amazonaws.com/brohan/brunno/logos/stream2file627527955211273161.gif","thumbnailPath":"http://s3.amazonaws.com/brohan/brunno/logos/stream2file627527955211273161.gif"},{"id":189,"name":"stream2file8123197123116094246.gif","dateUploaded":1487258631180,"path":"http://s3.amazonaws.com/brohan/brunno/logos/stream2file5137169752946663846.gif","thumbnailPath":"http://s3.amazonaws.com/brohan/brunno/logos/stream2file5137169752946663846.gif"},{"id":135,"name":"FriskiesNoPurina.png","dateUploaded":1487121163125,"path":"http://s3.amazonaws.com/brohan/brunno/logos/stream2file7018111325862312684.png","thumbnailPath":"http://s3.amazonaws.com/brohan/brunno/logos/stream2file7018111325862312684.png"},{"id":71,"name":"hp_3d.jpg","dateUploaded":1485304350438,"path":"http://s3.amazonaws.com/brohan/brunno/logos/stream2file6754910152804610695.jpg","thumbnailPath":null},{"id":10,"name":"kellogs.jpg","dateUploaded":1479314926862,"path":"http://s3.amazonaws.com/brohan/brunno/logos/stream2file3985102769436302708.jpg","thumbnailPath":null}
]}
Generate the watermark request.

/cv_backend/api/video_upload/{videoUploadId}/video/finalize/watermark (POST)

A JSON with the information about the placement, such as the example below, must be in the request body:

{"filterType":"WATERMARK",
"initTimeLogo":0, //time in seconds
"endTimeLogo":9600, //time in seconds
"sceneId":24944, //id of the first scene
"x":0, //x starting at left side
"y":0, // y starting at upper side
"w":600,
"h":600,
"logoId":484 // id of the logo
}
Generate the final video using the coordinates passed on the JSON and the media file from the previous request.
Check if logo embedding is done + get final url/cv_backend/api/video_upload/{id}  (GET)Check wether the logo embedding is done and, if it is completed, get the final video url from the VideoUpload entity.

5- Upload rule creation

This user flow allows for the creation of constraints inside the current account regarding the type of media files that can be uploaded to that particular account/

 

API CALLS

StepAPI CallDescription
Rule Creation

/cv_backend/rules/add

(POST)

A JSON with the serialized rule, like the example below:

{"ruleJson":
 "{\r\n\t\"minimumLength\" : 10, 
\r\n\t\"maximumLength\" : 30,
\r\n\t\"aspectRatio\": 1,
\r\n\t\"minimumHeight\": 200,
\r\n\t\"minimumWidth\": 200\r\n\r\n}", "ruleClass":"UploadFormatRule", "ruleTime":"ON_ANALYSIS"}

 

 

Creates an upload rule that will block upload of content not meeting those specifications. Returns the id of the created rule
Rule deletion/cv_backend/rules/delete/{id}
(DELETE)
Delete a given upload rule.

Other flows and functionalities

For other flows and functionalities, please contact brunno@uruvideo.com for more details on how to use the other methods of the API to the best of your needs.

  • No labels