Create asset from URL

POST /assets

Create a new video asset in FastPix.

application/json

Body

Request body for uploading a video asset from URL

  • inputs array[object] Required

    Input will consist url, startTime, endTime, type, languageCode, name and closedCaption.

    Hide inputs attributes Show inputs attributes object
    • type string

      This option is mandatory posssible values are video audio text and watermark.

      • Example "video"
    • url string

      The URL of the file that FastPix should download and use.

      • The URL to the FastPix file, such as an MP4, MOV, MKV, or TS file, should be provided as the main input file for FastPix to download. FastPix is capable of handling a wide range of audio/video file formats and codecs, but for optimal processing speed, it is recommended to use standard inputs whenever available.
      • When it comes to audio tracks, the URL refers to the specific location of the audio file that FastPix needs to download. This audio file can be in formats such as M4A, WAV, or MP3. FastPix has comprehensive support for a wide variety of audio file formats and codecs. However, for the sake of achieving the highest processing speed, it is recommended to utilize standard inputs whenever they are available.
      • In the case of text tracks, the URL represents the specific location of the subtitle/captions file. FastPix has the capability to support SubRip Text (SRT) and Web Video Text Tracks (WebVTT) formats for importing subtitles and closed captions. These formats are compatible with FastPix's ingestion system for text tracks.
      • Example "https://storage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
    • Video startup time is the duration from pressing "play" to the video starting to move. (for audio/video only)

    • endTime number

      Video end time is when video is ended" (for audio/video only)

    • The language code must be compliant with the BCP 47 standard to ensure compatibility. (for text only)

    • Name of the track. (for text only)

    • This track includes subtitles catering to the needs of hearing impaired/disabled people. (for text only)

    • Hide placement attributes Show placement attributes
      • xAlign string

        where watermark shoud be align. Possible vales top, bottom and middle (for watermark only)

      • xMargin string

        where watermark shoud be margin. Possible vales formats 10px and 10% (for watermark only)

      • yAlign string

        where watermark shoud be align. Possible vales left, right and center (for watermark only)

      • yMargin string

        where watermark shoud be margin. Possible vales formats 10px and 10% (for watermark only)

    • width string

      width of the watermark. Possible vales formats 10px and 10% (for watermark only)

    • height string

      height of the watermark. Possible vales formats 10px and 10% (for watermark only)

    • opcity string

      opacity of the watermark. Possible vales range 00% to 100% (for watermark only)

  • accessPolicy string Required

    determines if access to the streamed content is kept private or available to all.

    • Example "accessPolicy": "public"

    • Possible values: "public", "private"

  • metadata object

    Videos can be tagged with metadata tags in "key" : "value" pairs. You can search for videos with specific key value pairs using this parameter. Dynamic Metadata allows you to define a key that allows any value pair. Max: 255 characters. Upto 10 entries are allowed.

  • Subtitles or captions are on-screen text synchronized with the audio of a video file. They provide a written transcript of the spoken words, enhancing the video's accessibility and comprehension.

    Default value is false.

  • Level the audio track's overall volume. This parameter is specifically designed for pre-recorded content.

    Default value is true.

  • The maximum resolution tier determines the highest quality your asset will be available in. Omitting this setting will set the default resolution to 1080p.

Responses

  • 201 application/json

    Asset is created successfully

    Hide response attributes Show response attributes object
    • success boolean

      It demonstrates either the request is successfull or not.

    • data array[object]
      Hide data attributes Show data attributes object
      • id string

        The Asset is assigned a universal unique identifier, which can contain a maximum of 255 characters.

      • status string

        The status of the asset.

      • Subtitles or captions are on-screen text synchronized with the audio of a video file. They provide a written transcript of the spoken words, enhancing the video's accessibility and comprehension.

      • Time the Asset was created, defined as a localDateTime (UTC Time).

      • Time the Asset was updated, defined as a localDateTime (UTC Time).

      • playbackIds array[object]

        An array of Playback ID objects. Use these to create HLS playback URLs. Play your video with the Url.

        Hide playbackIds attributes Show playbackIds attributes object
        • id string(uuid)

          Unique identifier for the PlaybackID

        • Determines if access to the streamed content is kept private or available to all.

      • metadata object

        Videos can be Associated with metadata tags in "key" : "value" pairs. You can search for videos with specific key value pairs using this parameter. Dynamic Metadata allows you to define a key that allows any value pair. Max: 255 characters. Upto 10 entries are allowed.

      • The maximum resolution tier determines the highest quality your asset will be available in. Omitting this setting will set the default resolution to 1080p.

  • 401 application/json

    Unauthorized

    Hide response attributes Show response attributes object
    • success boolean

      It demonstrates either the request is successfull or not.

    • error object
      Hide error attributes Show error attributes
      • code integer

        Displays the status code of the error.

      • message string

        It demonstrates the cause of the error.

  • 422 application/json

    Payload Validation Failed

    Hide response attributes Show response attributes object
    • success boolean Required

      It demonstrates either the request is successfull or not.

    • error object Required
      Hide error attributes Show error attributes
      • code integer Required

        Displays the status code of the error.

      • message string Required

        It demonstrates the cause of the error.

      • fields array[object] Required
        Hide fields attributes Show fields attributes object
        • field string

          Shows the field name related to the error.

        • message string

          Shows why the error occur.

POST /assets
curl \
 -X POST https://api.fastpix.io/v1/video/assets \
 --user "username:password" \
 -H "Content-Type: application/json" \
 -d '{"inputs":[{"type":"video","url":"https://storage.googleapis.com/gtv-videos-bucket/sample/ForBiggerJoyrides.mp4"}],"metadata":{"key1":"value1"},"accessPolicy":"public","generateSubtitles":false,"normalizeAudio":true,"maxResolution":"1080p"}'
Request example
{
  "inputs": [
    {
      "type": "video",
      "url": "https://storage.googleapis.com/gtv-videos-bucket/sample/ForBiggerJoyrides.mp4"
    }
  ],
  "metadata": {
    "key1": "value1"
  },
  "accessPolicy": "public",
  "generateSubtitles": false,
  "normalizeAudio": true,
  "maxResolution": "1080p"
}
Response examples (201)
{
  "success": true,
  "data": [
    {
      "id": "iyuU4HFxhJg1vMHM2uztnJut1hIJBuNBSzJionwUV7c",
      "status": "preparing",
      "generateSubtitles": false,
      "createdAt": "2023-10-20T10:50:34.594302",
      "updatedAt": "2023-10-20T10:50:34.594302",
      "playbackIds": [
        {
          "id": "6ta85f64-5717-4562-b3fc-2c963f66afa6",
          "accessPolicy": "public"
        }
      ],
      "metadata": {
        "key1": "value1"
      },
      "maxResolution": "1080p"
    }
  ]
}
Response examples (401)
{
  "success": false,
  "error": {
    "code": 401,
    "message": "Unauthorized"
  }
}
Response examples (422)
{
  "success": false,
  "error": {
    "code": 422,
    "message": "payload validation failed",
    "fields": [
      {
        "field": "fieldName",
        "message": "must not be null"
      }
    ]
  }
}