# Get it
cd
test -f installed/ffmpeg-4.1.tar.xz && mv -f installed/ffmpeg-4.1.tar.xz .
test ! -f ffmpeg-4.1.tar.xz &&
wget http://ffmpeg.org/releases/ffmpeg-4.1.tar.xz
# Verify tarball w/ sha256sum:
# (this came from my gpg-verified tarball)
echo "a38ec4d026efb58506a99ad5cd23d5a9793b4bf415f2c4c2e9c1bb444acd19\
94 ffmpeg-4.1.tar.xz" | sha256sum -c
# Remove old version shared library files and .so.* symlinks - if you're
# _positive_ that nothing else is still using them
LIBSTOCLEAN="avcodec avdevice avfilter avformat avutil postproc \
swresample swscale"
for ldir in /usr/local/lib /usr/local/lib64; do
for libtoclean in $LIBSTOCLEAN; do
find $ldir -type f -name "lib${libtoclean}.so.*" -exec rm {} \;
find $ldir -type l -name "lib${libtoclean}.so.*" -exec rm {} \;
done
done
unset LIBSTOCLEAN
# Install it
make install
ldconfig
# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .
# Become your non-root user again
exit
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/ffmpeg-*.tar.*
mv ffmpeg-4.1.tar.xz installed/
# If you ever want to uninstall FFmpeg, this should do it:
cd
su
test -d src/ffmpeg-* && ( cd src/ffmpeg-* ; make uninstall )
( /usr/local/bin ; rm -f ffmpeg ffprobe ffserver )
test -d /usr/local/doc/ffmpeg && rm -r /usr/local/doc/ffmpeg
test -d /usr/local/include/libavcodec && rm -r /usr/local/include/libavcodec
test -d /usr/local/include/libavdevice &&
rm -r /usr/local/include/libavdevice
test -d /usr/local/include/libavfilter &&
rm -r /usr/local/include/libavfilter
test -d /usr/local/include/libavformat &&
rm -r /usr/local/include/libavformat
test -d /usr/local/include/libavutil && rm -r /usr/local/include/libavutil
test -d /usr/local/include/libpostproc &&
rm -r /usr/local/include/libpostproc
test -d /usr/local/include/libswresample &&
rm -r /usr/local/include/libswresample
test -d /usr/local/include/libswscale && rm -r /usr/local/include/libswscale
( cd /usr/local/lib
rm -f libavcodec.* libavdevice.* libavfilter.* libavformat.*\
libavutil.* libpostproc.* libswresample.* libswscale.* )
( cd /usr/local/lib/pkgconfig
libavcodec.pc libavdevice.pc libavfilter.pc libavformat.pc\
libavutil.pc libpostproc.pc libswresample.pc libswscale.pc )
( cd /usr/local/lib64
rm -f libavcodec.* libavdevice.* libavfilter.* libavformat.*\
libavutil.* libpostproc.* libswresample.* libswscale.* )
( cd /usr/local/lib64/pkgconfig
libavcodec.pc libavdevice.pc libavfilter.pc libavformat.pc\
libavutil.pc libpostproc.pc libswresample.pc libswscale.pc )
( cd /usr/local/man/man1
rm -f ffmpeg.1 ffmpeg-*.1 ffprobe.1 ffprobe-*.1 ffserver.1\
ffserver-*.1 )
( cd /usr/local/man/man3
rm -f libavcodec.3 libavdevice.3 libavfilter.3 libavformat.3\
libavutil.3 libswresample.3 libswscale.3 )
test -d /usr/local/share/doc/ffmpeg && rm -r /usr/local/share/doc/ffmpeg
test -d /usr/local/share/ffmpeg && rm -r /usr/local/share/ffmpeg
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "ffmpeg-*" -exec rm -r {} \;
rm -f ~/installed/ffmpeg-*.tar.*