I created a Node.js app that gets an RTSP stream with FFmpeg to analyse it with OpenCV 3. It is working if I install FFmpeg and OpenCV in my local.
But now I created a Docker image that contains the installation of those libraries and I'm using it as a base to create another image & container where I'm trying to run my app. When I run it inside that container I get this error over and over again when trying to get the RTSP stream with an FFmpeg instruction for
method SETUP failed: 455 Method Not Valid in This State
This is how I am installing FFmpeg in the image:
# ---------------------- OpenCV ffmpeg ---------------------------#
RUN mkdir -p /opt/src \
&& curl -Lo /opt/src/ffmpeg-${FFMPEG_VERSION}.tar.gz \
http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 \
&& tar -xvf /opt/src/ffmpeg-${FFMPEG_VERSION}.tar.gz -C /opt/src \
&& cd /opt/src/ffmpeg-${FFMPEG_VERSION} \
&& ./configure --enable-gpl --enable-avresample --enable-libopencore-amrnb \
--enable-libx264 --enable-libxvid --enable-postproc --enable-version3 \
--enable-shared --enable-pic --extra-ldexeflags=-pie \
&& make -j $(nproc) \
&& make install \
&& ldconfig -v \
&& rm -rf /opt/src
# ---------------------- OpenCV stuff ---------------------------#
RUN mkdir -p /opt/src/opencv-${OPENCV_VERSION}/build \
&& curl -sLo /opt/src/opencv3.tar.gz \
https://github.com/Itseez/opencv/archive/${OPENCV_VERSION}.tar.gz \
&& tar -xzvf /opt/src/opencv3.tar.gz -C /opt/src \
&& cd /opt/src/opencv-${OPENCV_VERSION}/build \
&& cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D WITH_TBB=ON \
-D WITH_OPENMP=ON \
-D WITH_FFMPEG=ON .. \
&& make -j "$(nproc)" \
&& make install \
&& ldconfig -v \
&& rm -rf /opt/src
Do you have any idea what this error is and how to fix it? I think it might have to do with the initial configuration on the installation of either of them (FFmpeg or OpenCV).
There is a fix in the new version of OpenCV released recently (OpenCV 3.1) that takes in consideration TCP transport, so by upgrading to the newest I managed to fix the problem.