Ingest
Introduction
Ingest means to pull media from a remote source and store it in Ittybit.
You can ingest files from any public or signed URL.
For example, you may have an archive full of video files in an existing S3 bucket, and you want to ingest them into ittybit so you can process them and make them available for delivery.
If you already have media files online, ingest is the fastest way to get started with ittybit.
If you need to upload media from your user client directly, you can instead Upload media with a few lines of code.
How to ingest media
There are two options for ingesting media:
- Create a new file from a URL (synchronous)
- Create an ingest task (asynchronous)
1. Create a new file from a URL
If you need immediate access to the file for delivery, or to access the file's metadata, you can create a new file from a URL synchronously.
Request
Ittybit's server will download the file from the URL, analyse it, and store it in your project.
Response
A successful response will include a File object.
2. Create an ingest task
You can also create an ingest task to ingest a file asynchronously. This will start the ingestion process and return a task_id
immediately, without waiting for the file to be ingested.
This is the better option if you need to ingest a large number of files without waiting for each file to complete before moving on, or if you are ingesting files in a cron job, scheduled batch, etc.
Request
Response
A successful response will include a Task object.
The file will be ingested in the background and you can either poll the task occasionally for updates, or set up a webhook to notify you when the file is ready.
Poll for updates
When the task is complete, the task object will contain an output
object with the file data.
Additional props
Both File and Task approaches support additional properties, which can be included in the request's JSON body.
For example, you might set a specific folder
or filename
for the ingested file.
Signed URLs
The examples above show a URL that is publicly accessible. If you need to ingest a file from a URL that is not publicly accessible, you can provide a signed URL to the API.