Sources

Sources

Introduction

Sources are File Objects with a kind of video, audio, or image.

They represent the files in your project that contain the actual content.

{
  "id": "file_abcdefgh1234",
  "object": "source",
  "kind": "video",
  "type": "video/mp4;codecs=avc1,mp4a",
  // ... other props
  "url": "https://your-project.ittybit.net/bunny/video.mp4",
  "ref": "original",
}

Media objects can contain one or more Sources.

{
  "id": "med_abcdefgh1234",
  "object": "media",
  "kind": "video",
  "files": [
    {
      "id": "file_abcdefgh1234",
      "object": "source",
      "kind": "video",
      "type": "video/mp4;codecs=avc1,mp4a",
      "url": "https://your-project.ittybit.net/bunny/video.mp4",
      "ref": "original",
    },
    {
      "id": "file_abcdefgh5678",
      "object": "source",
      "kind": "video",
      "type": "video/webm;codecs=vp9,opus",
      "url": "https://your-project.ittybit.net/bunny/video.webm",
      "ref": "webm",
    }
  ],
  // ... other props
}

Usage

At it's simplest, a source is what you'd pass to an <img>, <video>, or <audio> tag's src attribute.

<video src="https://your-project.ittybit.net/trailer.mp4" type="video/mp4">

In production projects, you'll usually want to provide multiple sources for a media object.

For example, you might want to generate a poster image for the video, which can be used to display a thumbnail or preview before playback begins.

<video poster="https://your-project.ittybit.net/bunny/poster.png">
  <source src="https://your-project.ittybit.net/bunny/video.mp4" type="video/mp4">
</video>

You might then want to provide a version of the video in the more efficient WEBM format for browsers that support it, and fallback to your MP4 version for browsers that don't.

<video poster="https://your-project.ittybit.net/bunny/poster.png">
  <source src="https://your-project.ittybit.net/bunny/video.webm" type="video/webm">
  <source src="https://your-project.ittybit.net/bunny/video.mp4" type="video/mp4">
</video>

See Media for more examples.

Media


Kinds

Sources can be of the following kinds:

  • video
  • audio
  • image

Video

Commonly used in <video> tags or as input for mobile, TV, and other video media players.

Video

Codecs & Containers

Uploaded or ingested files can contain:

PropertyValues
Video Stream Codech264/avc, h265/hevc, vp8, vp9, av1
Audio Stream Codecaac, opus, mp3, flac, vorbis
Media Containermp4, webm, mov, avi, mkv

Tasks can output:

PropertyValues
Video Stream Codech264/avc, vp9
Audio Stream Codecaac, opus
Media Containermp4, webm

If you require hevc, av1, or any other codecs or containers, please contact us.

Resolution

Uploaded or ingested files can be:

  • upto 4096px on the longest edge
  • upto 16MP in total pixels

Tasks have the same default limits. 1

Duration

Uploaded or ingested files can be:

  • upto 4 hours in duration

Tasks have the same default limits. 1

Filesize

Uploaded or ingested files can be:

  • upto 4TB in size

Tasks have the same default limits. 1

New Video

See the Video Tasks section for more information about creating new video sources.

Video Tasks


Image

Commonly used in <img> or <picture> tags.

Image

  <img src="https://your-project.ittybit.net/robot.png" alt="a little robot">

Formats

Uploaded or ingested files can be:

PropertyValues
Image Formatjpeg, png, webp, gif, hevc/heic, avif

Tasks can output:

PropertyValues
Image Formatjpeg, png, webp, gif, avif

If you require svg support, or need to support files in any other format, please contact us for early access.

Resolution

Uploaded or ingested files can be:

  • upto 8192px on the longest edge
  • upto 32MP in total pixels

Tasks have the same default limits. 1

HDR

We support HDR images in formats that allow it:

  • heic/heif with HEVC codec
  • avif with AV1 codec
  • webp with VP8 codec

Animation

We support animated gif, webp, and avif images.

Transparency

We support transparency in png, webp, avif, and gif images with an alpha channel.

Filesize

Uploaded or ingested files can be:

  • upto 4TB in size

New Image

See the Image Tasks section for more information about creating new image sources.

Image Tasks


Audio

Commonly used in <audio> tags.

<audio src="https://your-project.ittybit.net/podcast-001.mp3" type="audio/mp3">

Formats

Uploaded or ingested files can be:

PropertyValues
Audio Stream Codecaac, opus, mp3, flac, vorbis
Media Containermp3, m4a, wav, ogg

Tasks can output:

PropertyValues
Audio Stream Codecaac, opus, mp3
Media Containermp3, ogg, wav

If you require flac or any other audio codec, please contact us for early access.

Duration

Uploaded or ingested files can be:

  • upto 4 hours in duration

Tasks have the same default limits. 1

Filesize

Uploaded or ingested files can be:

  • upto 4TB in size

Tasks have the same default limits. 1

New Audio

See the Audio Tasks section for more information about creating new audio sources.

Audio Tasks


Footnotes

  1. If you need to increase these limits, please contact us. 2 3 4 5 6

On this page