🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more
Socket
Book a DemoInstallSign in
Socket

@eyevinn/ffmpeg-s3

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eyevinn/ffmpeg-s3

Run ffmpeg with output to S3

latest
npmnpm
Version
0.2.0
Version published
Maintainers
3
Created
Source

npm github release license

PRs welcome made with hearth by Eyevinn Slack

ffmpeg-s3

CLI and library for running ffmpeg with support for reading source from an S3 bucket and write the result to an S3 bucket.

Badge OSC

Requirements

ffmpeg executable must be available in path under the name ffmpeg. When using S3 for output the AWS CLI must be installed and configured,.

Installation / Usage

Eyevinn Open Source Cloud

Repackage the content from HLS to a MP4 container.

% export OSC_ACCESS_TOKEN=<personal-access-token>
% npx -y @osaas/cli create eyevinn-ffmpeg-s3 demo \
  -o awsAccessKeyId="{{secrets.accesskeyid}}" \
  -o awsSecretAccessKey="{{secrets.secretaccesskey}}" \
  -o s3EndpointUrl="https://eyevinnlab-birme.minio-minio.auto.prod.osaas.io" \
  -o cmdLineArgs="-i https://maitv-vod.lab.eyevinn.technology/VINN.mp4/master.m3u8 -c:v copy -c:a copy s3://output/demo/VINN.mp4"

Repackage content from MP4 to a MOV container where the source is on S3.

% npx -y @osaas/cli create eyevinn-ffmpeg-s3 demo \
  -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 -c:v copy -c:a copy s3://output/demo/trailer.mov"

Extract first 30 seconds of a video.

% npx -y @osaas/cli create eyevinn-ffmpeg-s3 demo \
  -o awsAccessKeyId="{{secrets.awsaccesskeyid}}" \
  -o awsSecretAccessKey="{{secrets.awssecretaccesskey}}" \
  -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/demo/trailer-30sec.mov"

CLI

% npm install -g ffmpeg-s3

Repackage the content from MP4 to a MOV container

% export AWS_ACCESS_KEY_ID=<aws-access-key-id>
% export AWS_SECRET_ACCESS_KEY=<aws-secret-access-key>
% ffmpeg-s3 -i s3://lab-testcontent-input.s3/NO_TIME_TO_DIE_short_Trailer_2021.mp4 -c:v copy -c:a copy s3://lab-testcontent-output/demo/trailer.mov

Library

import { doFFmpeg } from '@eyevinn/ffmpeg-s3';

doFFMpeg({
  cmdString:
    '-i s3://lab-testcontent-input/NO_TIME_TO_DIE_short_Trailer_2021.mp4 -c:v copy -c:a copy s3://lab-testcontent-output/demo/trailer.mov'
})
  .then(() => {
    console.log('done and uploaded');
  })
  .catch((err) => {
    console.error(err);
  });

Docker

docker build -t ffmpeg-s3:local .
docker run --rm \
  -e AWS_ACCESS_KEY_ID=<aws-access-key-id> \
  -e AWS_SECRET_ACCESS_KEY=<aws-secret-access-key> \
  ffmpeg-s3:local -i s3://lab-testcontent-input/NO_TIME_TO_DIE_short_Trailer_2021.mp4 c:v copy c:a copy s3://lab-testcontent-output/demo/trailer.mov

Development

Prerequisites:

  • ffmpeg
  • AWS cli

Run script locally

% npm run build
% node dist/cli.js -h

Contributing

See CONTRIBUTING

License

This project is licensed under the MIT License, see LICENSE.

Support

Join our community on Slack where you can post any questions regarding any of our open source projects. Eyevinn's consulting business can also offer you:

  • Further development of this component
  • Customization and integration of this component into your platform
  • Support and maintenance agreement

Contact sales@eyevinn.se if you are interested.

About Eyevinn Technology

Eyevinn Technology is an independent consultant firm specialized in video and streaming. Independent in a way that we are not commercially tied to any platform or technology vendor. As our way to innovate and push the industry forward we develop proof-of-concepts and tools. The things we learn and the code we write we share with the industry in blogs and by open sourcing the code we have written.

Want to know more about Eyevinn and how it is to work here. Contact us at work@eyevinn.se!

FAQs

Package last updated on 28 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts