@eyevinn/ffmpeg-s3
v0.2.0
Published
Run ffmpeg with output to S3
Readme
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.
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-s3Repackage 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.movLibrary
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.movDevelopment
Prerequisites:
- ffmpeg
- AWS cli
Run script locally
% npm run build
% node dist/cli.js -hContributing
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 [email protected] 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 [email protected]!
