Service: FFmpeg - EyevinnOSC/community GitHub Wiki

Getting Started

Process video with the versatile open source tool FFmpeg running as a job in Eyevinn Open Source Cloud. Available as an open web service to process videos without having to host your own infrastructure for it.

Prerequisites

Store access credentials as secrets

Create secrets for the access credentials to the storage server, for example accesskeyid and secretaccesskey . Read the guide on how to work with secrets for instructions on how to create a secret and refer to it.

Examples

Here are some examples of use cases that can be solved with FFmpeg and how we with the Open Source Cloud CLI can create an FFmpeg job. Before running any of the examples you need to set your personal access token in the environment variable OSC_ACCESS_TOKEN.

% export OSC_ACCESS_TOKEN=<your-personal-access-token>

You find your personal access token in the Open Source Cloud web console (Settings/API).

Extract first 30 seconds of a video

% npx -y @osaas/cli create eyevinn-ffmpeg-s3 example1 \
  -o awsAccessKeyId="{{secrets.accesskeyid}}" \
  -o awsSecretAccessKey="{{secrets.secretaccesskey}}" \
  -o s3EndpointUrl="https://eyevinnlab-birme.minio-minio.auto.prod.osaas.io" \
  -o cmdLineArgs="-i s3://input/VINN.mp4 -ss 0 -t 30 -c:v copy -c:a copy s3://output/example1/trailer-30sec.mov"

The source file is on the bucket called input on the MinIO instance with the address https://eyevinnlab-birme.minio-minio.auto.prod.osaas.io. The output is stored in the bucket called output on the same MinIO instance.

Once completed the 30 first seconds of the file VINN.mp4 is available in the bucket and folder as specified. Here verified using the MinIO client.

% mc ls birme/output/example1/
[2025-06-29 15:45:44 CEST] 7.6MiB STANDARD trailer-30sec.mov

Repackage the content from HLS to a MP4 container

This example downloads an HLS package and repackage that into one MP4 video file.

% npx -y @osaas/cli create eyevinn-ffmpeg-s3 example2 \
  -o awsAccessKeyId="{{secrets.accesskeyid}}" \
  -o awsSecretAccessKey="{{secrets.secretaccesskey}}" \
  -o s3EndpointUrl="https://eyevinnlab-birme.minio-minio.auto.prod.osaas.io" \
  -o cmdLineArgs="-i https://vod.demo.osaas.io/osc-reel-9dd16/index.m3u8 -c:v copy -c:a copy s3://output/example2/osc-reel.mp4"

And let us verify the output, again with the MinIO client.

% mc ls birme/output/example2/
[2025-06-29 15:50:59 CEST]  24MiB STANDARD osc-reel.mp4

Crop a video

Here's an example command cropping a video to a width of 640 pixels, a height of 640 pixels, and starting the crop from coordinates 900 pixels across and 50 pixels down:

% npx -y @osaas/cli create eyevinn-ffmpeg-s3 example3 \
  -o awsAccessKeyId="{{secrets.accesskeyid}}" \
  -o awsSecretAccessKey="{{secrets.secretaccesskey}}" \
  -o s3EndpointUrl="https://eyevinnlab-birme.minio-minio.auto.prod.osaas.io" \
  -o cmdLineArgs="-i https://vod.demo.osaas.io/osc-reel-9dd16/index.m3u8 -filter:v "crop=640:640:900:50" s3://output/example3/osc-reel-cropped.mp4"

Convert video to GIF

In this example we convert the OSC reel to an animated GIF.

% npx -y @osaas/cli create eyevinn-ffmpeg-s3 example4 \
  -o awsAccessKeyId="{{secrets.accesskeyid}}" \
  -o awsSecretAccessKey="{{secrets.secretaccesskey}}" \
  -o s3EndpointUrl="https://eyevinnlab-birme.minio-minio.auto.prod.osaas.io" \
  -o cmdLineArgs="-i https://vod.demo.osaas.io/osc-reel-9dd16/index.m3u8 -vf "fps=10,scale=320:-1:flags=lanczos" -c:v gif  s3://output/example4/osc-reel.gif"

Here is the resulting file.

osc-reel

Troubleshooting

Ensure that the secrets you are referring to exists as you get no immediate feedback if that is wrong today.

Support

Join our Slack workspace for real-time support and to connect with other users.