compile ffmpeg on ec2 linux instance - no libfdk-acc available - linux

I’m compiling the ffmpeg on an ec2 amazon linux instance, but it threw me an error ERROR: libfdk_aac not found.
I'm following this guide http://trac.ffmpeg.org/wiki/CompilationGuide/Centos to first install the dependencies and compile the package.
yum install autoconf automake bzip2 bzip2-devel cmake freetype-devel gcc gcc-c++ git libtool make pkgconfig zlib-devel
mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
curl -O -L https://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" \
--extra-libs=-lpthread \
--extra-libs=-lm \
--bindir="$HOME/bin" \
--enable-gpl \
--enable-libfdk_aac \
--enable-libfreetype \
--enable-libmp3lame \
--enable-libopus \
--enable-libvpx \
--enable-libx264 \
--enable-libx265 \
--enable-nonfree
make
make install
hash -d ffmpeg
and this is the error message I've got
ec2-user#ip-xx-xxx-xx-xx 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" \
> --extra-libs=-lpthread \
> --extra-libs=-lm \
> --bindir="$HOME/bin" \
> --enable-gpl \
> --enable-libfreetype \
> --enable-libmp3lame \
> --enable-libopus \
> --enable-libvpx \
> --enable-libx264 \
> --enable-libx265 \
> --enable-nonfree
ERROR: libfdk_aac >= 3.98.3 not found
I tried installing libfdk_aac but there's no package found. I don't seem to come across any posts discussing this issue, or at least recently. Appreciate any pointers. thanks!
[ec2-user#ip-xx-xxx-xx-xx ffmpeg]$ sudo yum install libfdk-aac
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
No package libfdk-aac available.
Error: Nothing to do

Related

Docker image generating error for /usr/bin/java

I am trying to run this docker image, but not sure why I am getting this error:
/usr/bin/time: cannot run /usr/bin/java: No such file or directory
Command exited with non-zero status 127
Can someone please help me debug this error?
My docker file:
FROM openjdk:8-jre
LABEL maintainer="APN <xxx#xxx.edu>"
LABEL org.label-schema.schema-version="1.0"
# LABEL org.label-schema.build-date=$BUILD_DATE
LABEL org.label-schema.name="apn/addreadgroups"
LABEL org.label-schema.description="Image for adding read groups in .bam"
ENV PICARD_VERSION 2.20.8
WORKDIR /tmp
RUN apt-get update -y \
&& apt-get install --no-install-recommends -y \
make \
gcc \
g++ \
libz-dev \
libbz2-dev \
liblzma-dev \
ncurses-dev \
bc \
libnss-sss \
time \
&& cd /tmp \
&& wget -q -O /usr/bin/picard.jar https://github.com/broadinstitute/picard/releases/download/${PICARD_VERSION}/picard.jar \
&& ln -sf /usr/share/zoneinfo/America/Chicago /etc/localtime \
&& echo "America/Chicago" > /etc/timezone \
&& dpkg-reconfigure --frontend noninteractive tzdata \
&& apt-get clean all \
&& rm -rfv /var/lib/apt/lists/* /tmp/* /var/tmp/*
# This makes the image crazy large -- will find a workaround
# COPY human_g1k_v37_decoy* /usr/local/
COPY ./entrypoint.sh /usr/local/bin/
ENV PICARD /usr/bin/picard.jar
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
# CMD ["/bin/bash"]
and the entrypoint.sh:
JAVAOPTS="-Xms2g -Xmx${MEM}g -XX:+UseSerialGC -Dpicard.useLegacyParser=false"
CUR_STEP="AddOrReplaceReadGroups"
/usr/bin/java ${JAVAOPTS} -jar "${PICARD}" \
"${CUR_STEP}" \
I="${INBAM}" \
O=${BAMFILE} \
RGID=${FLOWCELL} \
RGLB=${LIBRARY} \
RGPL=${PLATFORM} \
RGPU=${FLOWCELL} \
RGSM=${SM}
Exit status 127 means no command found.
This is due to the java command in openjdk:8-jre not located in /usr/bin/java, see next:
$ docker run -it openjdk:8-jre which java
/usr/local/openjdk-8/bin/java

Compiled opencv3.2.0 on ubuntu16.04 failed

I failed to compile opencv3.2.0 on ubuntu 16.04,that is the error:
Build output check failed:Regex: 'command line option .* is valid for .* but not for C++'
I tried to add -D CMAKE_C_COMPILER=/usr/bin/gcc-5 and -D ENABLE_CXX11=ON but it didn't work...So how can i solve this problem?
Ubuntu 16.04.6 - amd64 : Build opencv-3.2.0
sudo apt build-dep opencv
sudo apt install cmake python3-dev python3-numpy libgl1-mesa-dev libgoogle-glog-dev \
libgphoto2-dev liblapack-dev libleptonica-dev libprotobuf-dev libraw1394-dev libtbb-dev \
libtesseract-dev libv4l-dev maven-repo-helper ocl-icd-opencl-dev protobuf-compiler \
python-dev libtiff-dev libswscale-dev python-vtk *gstreamer*-dev linux-libc-dev \
libavresample-dev libatlas-cpp-0.6-dev libopenblas-dev doxygen \
libinsighttoolkit4-dev liblapacke-dev
tar xvf opencv_3.2.0+dfsg.orig.tar.gz
cd opencv-3.2.0+dfsg/
tar xvf ../opencv_3.2.0+dfsg-6.debian.tar.xz
mkdir build && cd build/
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DOPENCV_MATHJAX_RELPATH=/usr/share/javascript/mathjax/ \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_EXAMPLES=ON \
-DINSTALL_C_EXAMPLES=ON \
-DINSTALL_PYTHON_EXAMPLES=ON \
-DWITH_FFMPEG=ON \
-DWITH_GSTREAMER=OFF \
-DWITH_GTK=ON \
-DWITH_JASPER=OFF \
-DWITH_JPEG=ON \
-DWITH_PNG=ON \
-DWITH_TIFF=ON \
-DWITH_OPENEXR=ON \
-DWITH_PVAPI=ON \
-DWITH_UNICAP=OFF \
-DWITH_EIGEN=ON \
-DWITH_VTK=ON \
-DWITH_GDAL=ON \
-DWITH_GDCM=ON \
-DWITH_XINE=OFF \
-DWITH_IPP=OFF \
-DBUILD_TESTS=OFF \
-DCMAKE_SKIP_RPATH=ON \
-DWITH_CUDA=OFF \
-DENABLE_PRECOMPILED_HEADERS=OFF \
-DWITH_IPP=OFF \
-DWITH_CAROTENE=OFF \
-DOPENCL_INCLUDE_DIR:PATH="/usr/include/CL/" ../
make ## no errors
.
[100%] Linking CXX executable ../../bin/opencv_version
.
[100%] Built target opencv_version

ERROR: dav1d >= 0.2.1 not found using pkg-config

I am trying to build ffmpeg with dav1d. I've successfully built davit using the following commands:
git clone --depth=1 https://code.videolan.org/videolan/dav1d.git && \
cd dav1d && \
mkdir build && cd build && \
meson .. && \
ninja
After that, I am running a config command for the FFmpeg and get the error:
PKG_CONFIG_PATH="/app/ffmpeg_build/lib/pkgconfig" ./configure \
--prefix="/app/ffmpeg_build" \
--pkg-config-flags="--static" \
--extra-cflags="-I/app/ffmpeg_build/include" \
--extra-ldflags="-L/app/ffmpeg_build/lib" \
--extra-libs="-lpthread -lm" \
--bindir="/usr/local/bin" \
--enable-gpl \
--enable-libass \
--enable-libmp3lame \
--enable-libfreetype \
--enable-libopus \
--enable-libvorbis \
--enable-libx264 \
--enable-libdav1d \
--enable-nonfree
(All other libs are installed and FFmpeg configures and builds correctly with them if I omit --enable-libdav1d, but in case of the above command I get):
ERROR: dav1d >= 0.2.1 not found using pkg-config
I think the reason could be that meson puts bin files in the wrong directory. Could anyone please help?
P.S. I am using Ubuntu 18.04.
Example of build commands for the other libs:
git -C x264 pull 2> /dev/null || git clone --depth 1 https://code.videolan.org/videolan/x264.git && \
cd x264 && \
PKG_CONFIG_PATH="/app/ffmpeg_build/lib/pkgconfig" ./configure --prefix="/app/ffmpeg_build" --bindir="/usr/local/bin" --enable-static --enable-pic && \
make && \
make install
To pass the build you have to add ninja install:
git clone --depth=1 https://code.videolan.org/videolan/dav1d.git && \
cd dav1d && \
mkdir build && cd build && \
meson --bindir="/usr/local/bin" .. && \
ninja && \
ninja install
But this not enough, if you run FFmpeg after, you'll get:
ffmpeg: error while loading shared libraries: libdav1d.so.4: cannot open shared object file: No such file or directory
To fix this issue add /usr/local/lib/x86_64-linux-gnu to the LD_LIBRARY_PATH:
export LD_LIBRARY_PATH+=":/usr/local/lib/x86_64-linux-gnu"

How to know how many arguments can be used for compiling vim totally?

My vim was compiled with the following configure.
./configure --prefix=/usr/local/ \
--with-features=huge \
--enable-multibyte \
--enable-cscope=yes \
--enable-perlinterp=yes \
--enable-rubyinterp=yes \
--with-ruby-command=/usr/bin/ruby \
--enable-luainterp=yes \
--enable-pythoninterp=yes \
--enable-python3interp=yes \
--enable-tclinterp=yes \
--enable-gui=gtk3 \
--enable-cscope \
--enable-xim \
--enable-fontset \
--with-x --with-compiledby=$USER
How to know how many arguments can be used for compiling vim totally?
And almost same puzzle,how to know how many arguments can be used for compiling ffmpeg totally?
By what method?
Is there a sentence describing that there are xxxx arguements for compling vim such as ..... in some manul?
You can find the list of all arguments simply with the help command :
:help feature-list

Installing the most recent stable version of nodejs Dockerfile

The following portion of Dockerfile installs node, but defaults to v.4.2.6, How do I install the most recent stable version 7.4.0:
RUN apt-get clean && apt-get update \
&& apt-get -yqq install \
apache2 \
nodejs \ ## nodejs installed here
php \
php-mcrypt \
php-curl \
php-mbstring \
php-xml \
php-zip \
libapache2-mod-php \
php-mysql \
git \
supervisor \
&& apt-get -y autoremove \
&& apt-get clean \
&& php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& ln -sf /dev/stdout /var/log/apache2/access.log \
&& ln -sf /dev/stderr /var/log/apache2/error.log
According to the documentation from nodejs.org you can install it by doing this :
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install -y nodejs
So your Dockerfile could be like this :
RUN curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash \
&& apt-get clean && apt-get update \
&& apt-get -yqq install \
apache2 \
nodejs \ ## It should be the good version
RUN apt-get clean && apt-get update \
&& apt-get -yqq install \
apache2 \
php \
php-mcrypt \
php-curl \
php-mbstring \
php-xml \
php-zip \
libapache2-mod-php \
php-mysql \
git \
supervisor \
&& apt-get -y autoremove \
&& apt-get clean \
&& php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& ln -sf /dev/stdout /var/log/apache2/access.log \
&& ln -sf /dev/stderr /var/log/apache2/error.log \
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash && nvm install 7.4.0 \
&& nvm use 7.4.0 \

Resources