Open TheTomer opened 5 years ago
Hi @TheTomer take a look at the capwindow example, which shows the bucolic webcam scene when streaming that URL:
$ go run ./cmd/capwindow/main.go http://187.157.229.132/mjpg/video.mjpg
Start reading device: http://187.157.229.132/mjpg/video.mjpg
Hope that helps!
Hi deadprogram, that same script doesn't seem to work on my end, I'm getting this error:
C:\Users\Tomer\go\src\gocv.io\x\gocv>go run ./cmd/capwindow/main.go http://187.157.229.132/mjpg/video.mjpg
Error opening video capture device: http://187.157.229.132/mjpg/video.mjpg
Might be something to do with Windows? I'd check your Windows firewall settings possibly. It runs fine on my Linux install.
I am running same OpenCV/GoCV version in my tests.
$ go run ./cmd/version/main.go
gocv version: 0.19.0
opencv lib version: 4.0.1
I don't think that's it, as I've allowed an exception for Go and Goland through the Windows Firewall but still getting nothing, while a matching script for Python's OpenCV works well.
On a side note, this script works correctly when streaming the laptop's webcam.
Not too sure as I do not use Windows regularly. Also, I only have Windows in a VM, so that also impacts a few things, but there is not any code that is OS specific in GoCV that is not in OpenCV itself.
Are you using the same OpenCV installation for Python as you are for GoCV? If not, just wondering if any compilation flags are different.
It's not the same installation, the one I use for Python was installed through Conda and it's version is 4.1.0.
The compilation flags for GoCV were these:
cmake C:\opencv\opencv-4.0.1 -G "MinGW Makefiles" -BC:\opencv\build -DENABLE_CXX11=ON -DOPENCV_EXTRA_MODULES_PATH=C:\opencv\opencv_contrib-4.0.1\modules -DBUILD_SHARED_LIBS=ON -DWITH_IPP=OFF -DWITH_MSMF=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_opencv_java=OFF -DBUILD_opencv_python=OFF -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_DOCS=OFF -DENABLE_PRECOMPILED_HEADERS=OFF -DBUILD_opencv_saliency=OFF -DCPU_DISPATCH= -DOPENCV_GENERATE_PKGCONFIG=ON -Wno-dev
I'm not sure about how to get that info for the conda package.
I was just looking at this issue's comments again, and was thinking that adding the exception for Go and Goland to Windows Firewall might not be the correct needed setting. You might need to add the executable that you are building using GoCV/OpenCV not the Go compiler itself.
@deadprogram I have also encountered this problem, in the win10 environment, it shows Error opening capture device: Error opening file,I don't know why. gocv version: 0.23.0 opencv lib version: 4.3.0
@deadprogram @TheTomer @TangShuancheng I have also encountered this problem, in the win7 environment, it shows: Error opening file: rtsp://admin:Qwer1234@192.168.15.213 gocv v0.27.0 opencv lib version: 4.5.0 The laptop's built-in camera can be successfully accessed But access to the external camera via rtsp fails I have tested that vlc can successfully access the external camera
@deadprogram @TangShuancheng @TheTomer Do you have a solution?
I ended up sticking with Python, so nothing too innovative on my end.
Hi, I'm trying to stream an MJPEG video using GoCV, but opening the when I try to read the capture, it fails. I'm fairly new to Go so I'm probably doing something wrong here, but I'm trying to replicate a code that's working for me in Python with OpenCV.
`package main
import ( "fmt" "gocv.io/x/gocv" )
func main() {
}`
This ends up failing at the if command. What am I doing wrong here?
I'm using Go 1.12, GoCV 0.19.0 and OpenCV 4.0.1 on Windows 10.