Open treygilliland opened 1 year ago
Patch fix for now is rebuilding opencv at the start of the docker image:
FROM gocv/opencv:4.6.0-arm64 as base
ARG OPENCV_VERSION=4.5.4
ENV OPENCV_VERSION=4.5.4
RUN curl -Lo opencv.zip https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \
unzip -q opencv.zip && \
curl -Lo opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip && \
unzip -q opencv_contrib.zip && \
rm opencv.zip opencv_contrib.zip && \
cd opencv-${OPENCV_VERSION} && \
mkdir build && cd build && \
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D WITH_IPP=OFF \
-D WITH_OPENGL=OFF \
-D WITH_QT=OFF \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-${OPENCV_VERSION}/modules \
-D OPENCV_ENABLE_NONFREE=ON \
-D WITH_JASPER=OFF \
-D WITH_JPEG=ON \
-D WITH_TBB=ON \
-D BUILD_DOCS=OFF \
-D BUILD_EXAMPLES=OFF \
-D BUILD_TESTS=OFF \
-D BUILD_PERF_TESTS=OFF \
-D BUILD_opencv_java=NO \
-D BUILD_opencv_python=NO \
-D BUILD_opencv_python2=NO \
-D BUILD_opencv_python3=NO \
-D OPENCV_GENERATE_PKGCONFIG=ON \
.. && \
make -j $(nproc --all) && \
make preinstall && make install && \
ldconfig && \
cd / && rm -rf opencv*
@deadprogram any idea as to why this is the case? I spent some more time with this problem today. 4.7.0 works fine when opening a VideoCapture on an RTSP stream on amd64, but not arm64. It seems to have something to do with the V4L2 backend but not sure.
When I specify to use the ffmpeg backed and run apt-get install ffmpeg
, again amd64 works fine and arm64 fails.
It would be really great to use the same image tag across both architectures if possible so I don't have to maintain separate Dockerfiles.
Thanks!
Same issue here.
I have been using the Dockerfile on gocv/opencv for amd64 for a while to read from an RTSP stream and it has worked totally fine. I am now trying to use the arm64 image and it fails to open the RTSP stream successfully.
Description
Steps to Reproduce
docker run -it --rm gocv/opencv:4.7.0 bash
main.go:
go.mod:
go mod tidy
to download dependenciesOPENCV_LOG_LEVEL=DEBUG go run main.go
Your Environment
env.sh
orenv.cmd
script before trying togo run
orgo build
? N/AOther
arm output:
amd output: