FFMPEG Install/enable 'libfdk_aac' after installed FFMPEG via PPA - ffmpeg

I have linux MINT 17.3 Kernel 4.4.0-81 all update available. (For different reasons I can't move to newer version of ubuntu/mint)
I have installed FFMPEG via PPA (NOT from compiling the source):
sudo add-apt-repository ppa:jonathonf/ffmpeg-3 -y
sudo apt-get update
sudo apt-get install -y ffmpeg
Then I tried to install libfdk-aac with guide:
https://trac.ffmpeg.org/wiki/CompilationGuide/Quick/libfdk-aac
sudo apt-get install pkg-config autoconf automake libtool
git clone https://github.com/mstorsjo/fdk-aac.git
cd fdk-aac
./autogen.sh
./configure --enable-shared --enable-static
make
sudo make install
sudo ldconfig
But I'm still receive from FFMPEG: "unknown encoder 'libfdk_aac'"
How can I check if "libfdk_aac' is correctly installed and HOW CAN I ACTIVATE / ENABLE the 'libfdk_aac' on FFMPEG?
If is not possible in my situation, and if I'm obliged to remove all ffmpeg and follow this:
https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu

FFmpeg does not have a "plug-n-play" codec system. If you want to add another external codec you must compile FFmpeg.
Alternatively, you could find a static ffmpeg binary that includes your desired codecs, but this is not a likely option due to the non-free/GPL incompatible situation of the fdk-aac license.
Your best option if you want to use libfdk_aac is to follow the compile guide you linked to. You can even keep the ffmpeg you installed from that PPA because the guide does not interfere with any existing repository ffmpeg.

Related

centos:centos7 image is missing libgcc_s.so for cross compiling aarch64

I'm trying to setup a docker file that uses the x86_64 centos:centos7 docker image to cross compile to aarch64. The only problem is I'm missing libgcc_s.so for cross compiling, and I'm not sure why. I also noticed that there were no official glibc-aarch64 so I went with Computational's packages. I've provided my docker file, and any help would be appreciated.
FROM centos:centos7
RUN yum -y update \
&& yum -y install epel-release \
&& yum -y install clang gcc gcc-c++ make wget \
&& yum -y install gcc-aarch64-linux-gnu gcc-c++-aarch64-linux-gnu
RUN yum install -y http://springdale.princeton.edu/data/springdale/7/x86_64/os/Computational/glibc-aarch64-linux-gnu-2.24-2.sdl7.2.noarch.rpm
RUN yum install -y http://springdale.princeton.edu/data/springdale/7/x86_64/os/Computational/glibc-aarch64-linux-gnu-devel-2.24-2.sdl7.2.noarch.rpm
CMD ["/bin/bash"]
I'm not sure on the exact reason why, but gcc-aarch64-linux-gnu and gcc-c++-arch64-linux-gnu were compiled with --disable-shared. This prevents them from building libgcc_s.so. My best guess on why is because the shared library isn't always used and it's more common to use libgcc.a.
The two solutions that I had were to either build libgcc from source, or to copy the libgcc_s.so from another repo with the same version. I ended up extracting libgcc_s.so from libgcc-4.8.5-44.el7.aarch64.rpm.

Where to find old ffmpeg/ffprobe documentation?

There are several different versions of ffmpeg and ffprobe flying around, and each version has a different API.
If I apt-get install ffmpeg on Ubuntu 16.04, I get ffmpeg version 2.8.15-0ubuntu0.16.04.1. If I install apt-get install ffmpeg on Ubuntu 18.04, I get version 3.4.4-0ubuntu0.18.04.1.
When I visit the ffmpeg documentation, it says "The following documentation is regenerated nightly, and corresponds to the newest FFmpeg revision. Consult your locally installed documentation for older versions." That is, the hosted documentation is neither of those two versions.
So I have two questions:
What does it mean "your locally installed documentation"? Is it only talking about man ffmpeg? Or is there some way to host the documentation as a webpage?
Are there any places that simply host the older versions of the ffmpeg documentation?
For anyone who uses docker and wants to just host the docs without thinking too much, this is the Dockerfile I came up with.
FROM ubuntu:18.04
# Install requirements for ffmpeg doc generation
RUN apt-get update && apt-get install -y git build-essential texinfo yasm
# Install requirements for minimal webserver
RUN apt-get install -y webfs mime-support && update-mime
RUN git clone https://git.ffmpeg.org/ffmpeg.git
# Checkout the version that you want
RUN cd ffmpeg \
&& git checkout tags/n2.8.15 \
&& ./configure \
&& make doc
WORKDIR /ffmpeg/doc
CMD webfsd -F -p 80
Then you can
docker build -t ffmpeg-doc .
docker run --rm -it -p 80:80 ffmpeg-doc
And visit http://localhost for the list of generated files. The common ones will be http://localhost/ffmpeg.html or http://localhost/ffprobe.html.
What does it mean "your locally installed documentation"? Is it only talking about man ffmpeg?
It is referring to the various man pages and ffmpeg -h.
Are there any places that simply host the older versions of the ffmpeg documentation?
You can make it yourself. Install the build-essential and texinfo packages, download the source code for your FFmpeg version, then make the HTML documentation:
./configure
make doc
The HTML files will be located in the doc directory.
Alternatively, and more recommended, download or compile a recent version from the git master branch and use the online documentation.

compiling ffmpeg with nvidia/cuda failed loading nvcuvid

I am trying to compile an ffmpeg binary with support for using nvidia GPU's, I am running:
os: ubuntu 18.04
nvidia driver: nvidia-driver-390
cat /usr/local/cuda-9.0/version.txt => CUDA Version 9.0.176
gpu: 2x 1080ti
With the instructions shown on https://developer.nvidia.com/ffmpeg, being:
git clone https://git.ffmpeg.org/ffmpeg.git
cd ffmpeg
./configure --enable-cuda --enable-cuvid --enable-nvenc --enable-nonfree --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64
I first found the error ERROR: cuda requested, but not all dependencies are satisfied: ffnvcodec, which was solved with help from https://superuser.com/questions/1299064/error-cuvid-requested-but-not-all-dependencies-are-satisfied-cuda-ffnvcodec. Below is the summary (make and make install just gave a list of commands to run):
git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
cd nv-codec-headers
sed 's###PREFIX###/usr/local#' ffnvcodec.pc.in > ffnvcodec.pc
sudo install -m 0755 -d '/usr/local/include/ffnvcodec'
sudo install -m 0644 include/ffnvcodec/*.h '/usr/local/include/ffnvcodec'
sudo install -m 0755 -d '/usr/local/lib/pkgconfig'
sudo install -m 0644 ffnvcodec.pc '/usr/local/lib/pkgconfig'
With that done, I removed the ffmpeg folder, recloned it and ran within the folder:
./configure --enable-cuda --enable-cuvid --enable-nvenc --enable-nonfree --enable-libnpp --extra-cflags=-I/usr/local/cuda-9.0/include --extra-ldflags=-L/usr/local/cuda-9.0/lib64
make -j 10
Note that the path /usr/local/cuda-9.0 does contain both the include and lib64 folders, and that this resulted in no errors, just deprecation warnings.
Now when running this particular ffmpeg binary, with absolute paths, using the flag -hwaccel cuvid results in:
~/Documents/ffmpeg-cuda/ffmpeg/ffmpeg -y -hwaccel cuvid -c:v h264_cuvid -vsync 0 -i ~/test.mp4 -vf "scale_npp=1920:1072" -vcodec h264_nvenc ~/out1.mp4 -vf scale_npp=1280:720 -vcodec h264_nvenc out2.mp4
Which, is exactly what they have on their website to test it, results in:
[h264_cuvid # 0x556348eb94c0] Cannot load cuvidGetDecodeStatus
[h264_cuvid # 0x556348eb94c0] Failed loading nvcuvid.
I have also prepended: PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" before ./configure, but also did not make a difference.
What am I doing wrong? Is there something important I missed?
With the ffmpeg repo https://github.com/FFmpeg/nv-codec-headers, which is "FFmpeg version of headers required to interface with Nvidias codec APIs", I glanced over the fact that Linux needed a "396.24 or newer driver". And only CUDA toolkit 9.2 at least, supports this driver version. So, the order of commands I used I have forgotten, but was roughly like below in order to remove nvidia drivers and cuda software;
sudo apt remove cuda
sudo aot-get autoremove --purge cuda
cd /var
# Here I removed files like cuda-repo-9-0-local-xxx
cd /etc/apt/sources.list.d
# Here I removed files like cuda-9-0-xxx.list/save
Now using the GUI software & Updates, in the additional drivers tab, sometimes wouldnt let me change from 390 to 396, so I'm pretty sure I first changed to Nouveau display driver, restarted the computer, and then chose 396 NVIDIA driver (open source), restarted the computer again and then now using 396, a check with nvidia-smi showed 396.51.
I then went to https://developer.nvidia.com/cuda-downloads and downloaded the 9.2 Linux Ubuntu 17.04 .deb file and then:
wget https://developer.nvidia.com/compute/cuda/9.2/Prod2/local_installers/cuda-repo-ubuntu1710-9-2-local_9.2.148-1_amd64
mv cuda-repo-ubuntu1710-9-2-local_9.2.148-1_amd64 cuda-repo-ubuntu1710-9-2-local_9.2.148-1_amd64.deb
sudo dpkg -i --force-overwrite cuda-repo-ubuntu1710-9-2-local_9.2.148-1_amd64.deb
sudo apt-key add /var/cuda-repo-9-2-local/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda
Now with CudaToolKit 9.2 installed with nvidia-drvier version 396.51, re-doing the steps posted in my question, resulted in no errors when running ffmpeg with -hwaccel cuvid. Which by the way makes a MASSIVE difference!

how to install libx265 for ffmpeg build on centos 7

When I try to compile ffmpeg with libx265 (./configure --enable-gpl --enable-libx265), it is getting error as: (ERROR: x265 not found using pkg-config). How to install libx265 and get configure with ffmpeg.
There are two solutions to your problem.
A)
If there are no libx265 available on CentOS 7 then you'll have to build it yourself. It follows the pretty straightforward method of configure/make.
Using mercurial:
hg clone http://hg.videolan.org/x265
cd x265/build/linux
./make-Makefiles.bash
make -j6
make install
ldconfig
Then be sure to specify the path libx265 was installed to when building ffmpeg. With pkg-config: PKG_CONFIG_PATH="/usr/local/lib/pkgconfig".
B)
But it appears there are rpm entries for x265 on CentOS 7:
http://pkgs.org/centos-7/nux-dextop-x86_64/x265-devel-1.2-6.el7.nux.x86_64.rpm.html. If they are compatible on your system you should be able to simply install instead of building.
I wrote a script for Ubuntu recently, but I think it can be applied to CentOS. You need to comment off the Ubuntu apt-get in the script in order to get it running.
Also before you use it, please ensure that you have git and mercurial installed. My script pulls the latest copy of necessary libraries from either from git or mercurial.
https://github.com/tangingw/libx265_installer

How to load correct libavcodec.so shared library version? (53)

I am using libavcodec and libavformat in my project but when I execute a binary which was built on another machine, I get the following error:
error while loading shared libraries: libavcodec.so.53: cannot open shared object file: No such file or directory
I installed ffmpeg with libav and trying the following commands:
sudo apt-get install ffmpeg libavcodec-dev libavformat-dev
sudo apt-get install ffmpeg libavcodec-extra-53
sudo apt-get install libav-tools
The error doesnt show up when I build the binary on the same machine, but it would be much faster to compile on a second machine.
UDPATE: I also ran sudo apt-get install update and sudo apt-get install pkg-config without any change in the output. (OS = 12.04)
https://sites.google.com/site/linuxencoding/builds
try installing the linux binary for ffmpeg from the above website.
just so that every user benefits from this answer i am adding links to ffmpeg binaries available for different platforms
for centOS http://pkgs.repoforge.org/ffmpeg/
Tutorial for installation :
http://www.rackspace.com/knowledge_center/article/centos-installing-ffmpeg
for mac http://ffmpegmac.net/
for windows http://ffmpeg.zeranoe.com/builds/
also i have made a video tutorial to install a binary. but this is on mac. but i assume its the same for linux to.
https://www.youtube.com/watch?v=wiLNqg2IOAQ
hope this helps

Resources