AddVideo

This call allows an application to add (and preprocess) a video in ApertureData Platform. The minimum requirement for this call is the video blob. The video blob is an encoded binary array using any of the supported containers or encodings. While the application can choose to associate no properties or no collections with this video, it will make it harder to find the video later in such situations. In all scenarios, this call will also lead to an addition of an entity into the metadata database. If the information is provided to link this video with some previously searched or added entity through a user/application specified id, then such a link is also added to the metadata database.

Parameters

  • [optional] [[_ref|Keywords]]: for reference
  • [optional] codec: indicates the codec to be transcoded.
  • [optional] container: indicates the container used for the video file
  • [optional] index_frames: triggers key-frame index extraction on the video. This information will be used by [[FindFrames|FindFrames]] command to perform partial decoding rather than full decoding, which results in reduced memory consumption and faster command execution. More details will be available under [[FindFrames|FindFrames]] once the feature is complete.

Blocks

  • [optional] properties
  • [optional] operations
  • [optional] link

Codec and Containers

ApertureData Platform allows user to do transcoding at insertion and query time. When inserting a new video (using the AddVideo command), the user can choose to change the codec and/or container that will be used to store the video in ApertureData Platform. If the user wants to keep the same encoder and containers as passed in the video blob, the “coder” and “container” parameters must be skipped.

ApertureData Platform supports the following codecs:

  • xvid
  • h264
  • h263

ApertureData Platform supports the following video containers:

  • mp4
  • avi
  • mov

ApertureData Platform uses OpenCV/ffmpeg to operate on videos, so any codec/container available in those libraries can be easily included.

Operations

ApertureData Platform allows for operations to be performed to a Video at insertion and/or query time. The supported operations are detailed in the [[operations|Block-operations]], and are [threshold, resize, crop, interval]. These operations were chosen as samples or that were needed for some of the applications we were building. But given that we wrap around OpenCV for performing operations to videos, any operation supported by OpenCV can be easily added.

At least one operation must be defined in the array.

All the parameters are required for each operation. The parameters for the various operations supported are:

Examples

Insert a video, use mp4 as container for storage, and apply a resize and threshold operation:

{
  "AddVideo": {
      "container” : "mp4",  # will convert the video to mp4
      "properties" : {
          "name" : "The God Father",
          "length" : 120
      },
      "operations": [
          {
              "type": "resize",
              "w": 200,
              "h": 200,
          },
          {
              "type": "threshold",
              "value": 155,
          }
      ]
  }
}
+blob # the actual encoded video file as a blob

Insert a video after applying an “interval” operation. The interval operation can be used to store only a part of the video (using the start and end parameters), and/or to reduced change the number of frames per second (using the step parameters).

{
  "AddVideo": {
      "properties" : {
          "name" : "Mean Girls",
          "length" : 134,
          "rating": "top"
      },
      "operations": [
          {
              "type": "interval", # Interval Operation
              "start": 20,        # Start from the 20th frame
              "stop": 200,        # Stop at the 200th frame
              "step": 5           # Pick 1 every 5 frames.
          }
      ]
  }
}
+blob # the actual encoded video file as a blob