I am trying to compile ffmpeg
from sources and create deb
package in order to install ffmpeg globally and make it possible to remove it with dpkg -r
command.
Here are my commands.
# Installing FFmpeg
cd ~/ffmpeg_sources
wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
tar xjvf ffmpeg-snapshot.tar.bz2
cd ffmpeg
PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
--prefix="$HOME/ffmpeg_build" \
--pkg-config-flags="--static" \
--extra-cflags="-I$HOME/ffmpeg_build/include" \
--extra-ldflags="-L$HOME/ffmpeg_build/lib" \
--bindir="$HOME/bin" \
--enable-gpl \
--enable-libass \
--enable-libfdk-aac \
--enable-libfreetype \
--enable-libmp3lame \
--enable-libopus \
--enable-libtheora \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-libx265 \
--enable-nonfree
PATH="$HOME/bin:$PATH" make
sudo checkinstall --pkgname=ffmpeg --pkgversion="5:$(date +%Y%m%d%H%M)-git" --backup=no \
--deldoc=yes --fstrans=no --default
hash -r
Everything compiles successfully, deb packages are created but when I try to use ffmpeg
I get
ffmpeg: command not found
So that means that ffmpeg
still not installed in $PATH
directories.
What is wrong with my commands?
The tutorial you mentioned does not use checkinstall
because nothing is installed to the system: it "locally installs" the compiled binaries in the ~/bin
directory of the user performing the compiling. It does this for a variety of reasons: avoids the complexities of the package management system, avoids messing with system directories, makes updating compiled ffmpeg
easier, for shared server users it avoids root/superuser (assuming dependencies are available), and avoids conflicts with the ffmpeg package in the official repository.
Some methods to make your compiled ffmpeg
globally executable for all users:
This is easy:
sudo mv ~/bin/{ffmpeg,ffprobe,ffplay} /usr/local/bin
Downside is that it won't be integrated into the package management system, but that shouldn't be a big deal since undoing this is simple.
To "uninstall":
sudo rm /usr/local/bin/{ffmpeg,ffprobe,ffplay}
If you want to use checkinstall
to install the compiled ffmpeg
binary for integration into the package management system, and so any user can execute it:
cd ~/bin
sudo checkinstall --pkgname=ffmpeg --pkgversion="8:$(date +%Y%m%d%H%M)-git" --default install -Dm755 ffmpeg /usr/local/bin/ffmpeg
This assumes the ffmpeg
binary is in ~/bin
which it will be if you properly followed the tutorial.
Alternatively, you could remove --prefix="$HOME/ffmpeg_build"
and --bindir="$HOME/bin"
when configuring ffmpeg
, then run PATH="$HOME/bin:$PATH" make
, and finally run your checkinstall
command from your question if you want to install everything else (libraries, documentation, ffplay
, ffprobe
) too instead of just the ffmpeg
binary.
No comments:
Post a Comment