My encoding and decoding was working fine using ffmpeg and libav, but then I added a filter in the encoding step to rotate my video and it no longer works in my docker machine, BUT it does work locally.
The error message when compiling in docker is
//usr/local/lib/libavfilter.a(vf_pp.o): In function `pp_init':
/var/tmp/ffmpeg/libavfilter/vf_pp.c:56: undefined reference to `pp_get_mode_by_name_and_quality'
//usr/local/lib/libavfilter.a(vf_pp.o): In function `pp_uninit':
/var/tmp/ffmpeg/libavfilter/vf_pp.c:161: undefined reference to `pp_free_mode'
/var/tmp/ffmpeg/libavfilter/vf_pp.c:163: undefined reference to `pp_free_context'
//usr/local/lib/libavfilter.a(vf_pp.o): In function `pp_filter_frame':
/var/tmp/ffmpeg/libavfilter/vf_pp.c:142: undefined reference to `pp_postprocess'
//usr/local/lib/libavfilter.a(vf_pp.o): In function `pp_config_props':
/var/tmp/ffmpeg/libavfilter/vf_pp.c:115: undefined reference to `pp_get_context'
collect2: error: ld returned 1 exit status
These are my relevant configurations in docker file
# Install libx264 for video encoding.
RUN cd /var/tmp && curl -L http://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20190103-2245-stable.tar.bz2 > x264.tar.bz2 && \
echo "21cb6e2bb660f863713fb9f752654c65191e032dac1329ec113786c69f0f75c1 x264.tar.bz2" > x264.sha256sum && \
shasum -a 256 -c x264.sha256sum && \
tar xjf x264.tar.bz2 && \
cd x264-snapshot-20190103-2245-stable && \
./configure \
--enable-static \
--enable-pic \
--disable-cli \
--disable-avs \
--disable-opencl && \
make -j8 && \
make install-lib-static
# Compile ffmpeg.
COPY ffmpeg.tar /var/tmp/ffmpeg.tar
RUN cd /var/tmp && tar xf ffmpeg.tar && \
cd ffmpeg && \
./configure \
--cc=/usr/bin/clang-6.0 \
--cxx=/usr/bin/clang++-6.0 \
--extra-libs="-lpthread" \
--enable-gpl \
# without pic - opencv will throw up errors
--enable-pic \
--enable-libx264 \
--disable-network && \
make -j 8 && \
make install
Not sure this is relevant but here are my flags
LDFLAGS: -lavcodec -lavfilter -lswscale -lavutil -lswresample -lx264 -lm -lz
Here's my local ffmpeg configuration and version
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
built with Apple clang version 11.0.0 (clang-1100.0.33.17)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.2_2 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
Here's the output from my docker machine
ffmpeg version 4.1.1 Copyright (c) 2000-2019 the FFmpeg developers
built with clang version 6.0.0-1~bpo9+1 (tags/RELEASE_600/final)
configuration: --cc=/usr/bin/clang-6.0 --cxx=/usr/bin/clang++-6.0 --extra-libs=-lpthread --enable-gpl --enable-pic --enable-libx264 --disable-network
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
How can I get my configuration fixed so it works like in local? I didn't specifically configure my local environment so it's going to be using default configuration.
You are missing -lpostproc
in your LDFLAGS. Also, the order should be correct:
LDFLAGS=-lavfilter -lswscale -lpostproc -lswresample -lavcodec -lavutil -lx264 -lm -lz