Start integrating

Quickstart

Learn to create video sources, transcode jobs, configure storage, and set up webhooks with code examples.

The Chunkify API provides an easy interface to state of the art video transcoding. It allows you to have a powerful and lightning fast video transcoding solution and easily integrate it within your existing workflows. We will see some of the steps displayed in the workflow page.

Create a source from a hosted file

You can create a source from an already hosted file. Once the source is created, you can access all its specs.

We strongly recommend using S3 or an equivalent cloud storage for your hosted source files to ensure fast uploads and optimal performances.

import Chunkify from '@chunkify/chunkify';

const client = new Chunkify({
    projectAccessToken: 'My Project Access Token',
});

// Create the source
const source = await client.sources.create({ url: 'https://example.com/video.mp4' });

// You can access the source specs
console.log(source);
Configure your development environment

Install and configure an official Chunkify SDK to run the code above.

Create a transcode job

When your source is ready to use, you can create a transcode job using the source ID. Here is a basic example using h264 format and 720p resolution.

import Chunkify from '@chunkify/chunkify';

const client = new Chunkify({
    projectAccessToken: 'My Project Access Token',
});

// Transcode using h264 format with 720p resolution
const job = await client.jobs.create({
    source_id: source.id,
    format: { 
        id: 'mp4_h264',
        height: 720,
    }    
});
Learn more about transcoder settings

See how to configure your video processing settings.

Learn more about video format and codecs

See how to configure your transcode format and codec settings.

Setting up your storage

The storage is where the processed files are kept. Currently Chunkify supports AWS S3 storages and Cloudflare R2 storages.

By default Chunkify provides a test storage, this is for development and test purposes only. All the files will be deleted 24h after their creation. For production you'll need to setup your own storage to keep your processed files safe.

To setup your own storage you have to create one and attach it to your project. The project ID is availaible in the Chunkify app under the project settings, or you can use the API to get it.

import Chunkify from '@chunkify/chunkify';

let client = new Chunkify({
    projectAccessToken: 'My Project Access Token',
});

// Create a new storage
const storage = await client.storages.create({
    storage: {
        access_key_id: '1234567890',
        bucket: 'my-bucket',
        provider: 'aws',
        region: 'us-east-1',
        secret_access_key: '1234567890',
        base_prefix: 'chunkify/',
        public: false,
    }    
});

// Attach the storage to your project to use it
// Note: This requires a team access token, not a project access token
client = new Chunkify({
    teamAccessToken: 'My Team Access Token',
});
await client.projects.update('projectId', { storage_id: storage.id });
Learn more about storages

Check how we are handling storages and files.

Setting up a Webhook

Webhooks are a powerful tool that enables event-driven behavior. Rather than periodically checking the status of your jobs, you can set up a webhook to trigger a workflow when a job is completed. Chunkify can send notifications for various events throughout the transcoding process.

Here when a job is completed Chunkify will send a notification to the webhook URL

import Chunkify from '@chunkify/chunkify';

const client = new Chunkify({
    projectAccessToken: 'My Project Access Token',
});

// Create a webhook
const webhook = await client.webhooks.create({
    url: 'https://example.com/webhook',
    events: ['job.completed'],
})

We provide a way to test your webhook/notification workflow locally, for this you can use our CLI, see how to do it in the CLI section

Learn more about webhooks

Understand how our webhooks and notifications system works.