Using a newer version of FFmpeg with Docker.
source link: https://dev.to/ethand91/using-a-newer-version-of-ffmpeg-with-docker-3b69
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Posted on Feb 24
Using a newer version of FFmpeg with Docker.
Introduction
Hello, I needed to use FFmpeg in a node application, however the problem was the default FFmpeg that can be installed with the node image was too old and didn't support what I was trying to do.
There were two ways to handle this either compile FFmpeg from source, which would take a while and I really didn't want to have a long Dockerfile, not to mention the cleanup afterwards.
So I decided to copy the FFmpeg bin from the "jrottenberg/ffmpeg:4.4-alpine" into the Nodejs image. Reason being it's simpler.
Using FFmpeg 4.4 with the node image
To use the FFmpeg bin with the node image I changed the head of my Dockerfile like so:
FROM jrottenberg/ffmpeg:4.4-alpine AS FFmpeg
FROM node:16-alpine
COPY --from=FFmpeg / /
Enter fullscreen mode
Exit fullscreen mode
With this I was able to use FFmpeg 4.4 with the Node 16 image.
I also learned something new about Docker.
Hopefully this will help me in future projects, and hopefully be of use to you.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK