-
-
Save willmasters/382fe6caba44a4345a3de95d98d3aae5 to your computer and use it in GitHub Desktop.
# | |
sudo su - | |
cd /usr/local/bin | |
mkdir ffmpeg | |
cd ffmpeg | |
wget https://www.johnvansickle.com/ffmpeg/old-releases/ffmpeg-4.2.1-amd64-static.tar.xz | |
tar xvf ffmpeg-4.2.1-amd64-static.tar.xz | |
mv ffmpeg-4.2.1-amd64-static/ffmpeg . | |
ln -s /usr/local/bin/ffmpeg/ffmpeg /usr/bin/ffmpeg | |
exit |
Amazon Linux 2023 is out; one should upgrade as often as possible.
$ wget https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
$ tar -xjvf ffmpeg-snapshot.tar.bz2
$ cd ffmpeg
$ ./configure
$ make
$ sudo make install
$ ffmpeg -version
This worked for me in 2024, Amazon Linux 2
@Rudrabha your steps also work with AL2023, thanks!
I am using https://ffmpeg.org/releases/ffmpeg-7.0.tar.bz2
instead of the snapshot (which I believe is nightly?)
@Rudrabha Amazon Linux 2 is EOL and should not be used.
@RichardTMiles "Amazon Linux 2 end of support date (End of Life, or EOL) has been extended by two years from 2023-06-30 to 2025-06-30 to provide customers with ample time to migrate to the next version."
Noted @stevebanik, thanks. I’ll reiterate that everyone should be upgrading regularly. Avoiding inevitably is a poor decision IMHO. Get the latest and greatest from the newest versions. Support will end, and if you wait until the last minute you will be left insecure. It is MUCH easier to upgrade immediately as new major releases happen. Jumping 2-3 major versions is generally not a good time.
Solution May 2024
Given that nobody wants to post their solution, I figured I will :)
.ebextensions/ffmpeg.config
sources:
/usr/local/bin/ffmpeg: https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz
commands:
01_link_ffmpeg:
command: ln -sf /usr/local/bin/ffmpeg/ffmpeg*/ffmpeg /usr/bin/ffmpeg
My initial attempt was to only use Linux commands like wget and tar to download and extract the archive. However, running tar command would froze machine each time I ran it. The above works though without any issues.
@VladimirMikulic pretty cool, however this solution still relies on the remote server. I was in a situation where a public server for some package went down couple of times, disrupting deployments. For more "sensitive" projects I'd recommend periodically caching the file on your S3 bucket and using this solution:
commands:
install_ffmpeg:
command: |
if [ ! -e /usr/bin/ffmpeg ]
then
aws s3 cp s3://YOUR_BUCKET/ffmpeg-release-amd64-static.tar.xz ffmpeg-release-amd64-static.tar.xz
mkdir -p /usr/local
tar xf ffmpeg-release-amd64-static.tar.xz -C /usr/local
ln -sf /usr/local/ffmpeg-6.0-amd64-static/ffmpeg /usr/bin/ffmpeg
ln -sf /usr/local/ffmpeg-6.0-amd64-static/ffprobe /usr/bin/ffprobe
fi
You still have to download and upload the release file to S3, but it shouldn't be a big deal if you do it 2-3 times a year or have another CI/CD task to do it for you once a week.
@januszm thanks for the code snippet but tar is not an option for me since it frozes the machine unfortunately :)
I followed this medium post for install ffmpeg installation in Amazon Linux.
Link: Click here for link
@rajaduraicloud hey it’s better form to post what specifically was needed that worked for you, with a delta of what was given above. Links can changes, sites can go down, but a real comment with real code is written to last. I personally am not seeing any difference in the medium article and the code suggested above?
@akayalml Amazon Linux 2 doesn't have
xz
installed by default. You need to runyum install xz
andtar -xf
will work properly