Darknet: Problem with running the darknet in the "demo" mode

Created on 28 Feb 2017  路  14Comments  路  Source: AlexeyAB/darknet

Hi,

I tried many times to connect the camera through network and IP address exactly like tutorial, but no success. I use SmartWebCam application, and when I copy-paste the address ( http://192.168.1.2:8080/video?dummy=param.mjpg ) in the browser, it works and it shows the live video but I always get the below error with darknet.

video file: http://192.168.1.2:8080/video?dummy=param.mjpg
Couldn't connect to webcam.
: No error

Most helpful comment

@VanitarNordic No, it does not matter - VOC or custom.

Check, is there opencv_ffmpeg249_64.dll in folders:

  • C:\opencv_2.4.9\opencv\build\x64\vc12\bin
  • C:\opencv_2.4.9\opencv\build\x64\vc14\bin

If this file is present, then copy it to near with darknet.exe

If is not present, then you can try simply to download opencv_ffmpeg249_64.dll and put it near with exe-file: https://drive.google.com/open?id=0BwRgzHpNbsWBTEhYTV9BY29yNDA
Can you now detect on video: darknet.exe detector demo data/voc.data yolo-voc.cfg yolo-voc.weights test.mp4


If nothing above does not work, then build OpenCV with cmake.

Should I change something in Visual Studio for the darknet to get vc14 folder instead of vc12?

Now in darknet-project used both vc14 and vc12 folders for lib. I think you should not change it.

All 14 comments

@VanitarNordic Hi,

I think you used -c 0 in command line. You should use -c 0 only for WebCamera (USB/V4L), but not for Network-camera: https://github.com/AlexeyAB/darknet#how-to-use-on-the-command-line

Try to use this command such as for simple video-file: darknet.exe detector demo data/voc.data yolo-voc.cfg yolo-voc.weights http://192.168.1.2:8080/video?dummy=param.mjpg

@AlexeyAB

I use exactly your command but still the same error:

darknet.exe detector demo data/obj.data yolo-obj.cfg backup/yolo-obj_2000.weights http://192.168.1.2:8080/video?dummy=param.mjpg

@AlexeyAB

also, long time no seen man, at least two weeks. personally I had missed you and worry to what happened, counting day and night for you to come back and find answers to some problems.

@VanitarNordic It's okay, it was the holidays and work.

I get this error only if I write wrong IP.
Did you build OpenCV with FFMPEG?

FFMPEG

@AlexeyAB

I did not build the OPENCV. I just put it in the suitable directory to be detectable by darknet and compiled.

@VanitarNordic

When you use simple mpeg video-files, did you get this error?

And when you try to use SmartWebCam did you get the same error as on image?

error_webcam

This is the error. I have not tried a video file yet. let me do that and tell you.

error

Alright, I did that for a file either. the same error as above.

2

@VanitarNordic

Example how to build: http://www.codepool.biz/building-opencv-with-cmake-on-windows.html

But set WITH_FFMPEG:
FFMPEG

@AlexeyAB

Okay, I had not built it for VC14, because in the ReadMe you had mentioned:

If you have MSVS 2015, CUDA 8.0 and OpenCV 2.4.9 (with paths: C:\opencv_2.4.9\opencvbuild\include & C:\opencv_2.4.9\opencvbuildx64\vc12\lib or vc14\lib), then start MSVS, open build\darknet\darknet.sln, set x64 and Release, and do the: Build -> Build darknet

Should I change something in Visual Studio for the darknet to get vc14 folder instead of vc12?

also one thing, this is trained on a custom dataset, not original VOC. that would not cause an issue?

I installed the codec, I got some errors/warning both in CMake and when I tried to build the opencv vc14, but at the end no effect.

@VanitarNordic No, it does not matter - VOC or custom.

Check, is there opencv_ffmpeg249_64.dll in folders:

  • C:\opencv_2.4.9\opencv\build\x64\vc12\bin
  • C:\opencv_2.4.9\opencv\build\x64\vc14\bin

If this file is present, then copy it to near with darknet.exe

If is not present, then you can try simply to download opencv_ffmpeg249_64.dll and put it near with exe-file: https://drive.google.com/open?id=0BwRgzHpNbsWBTEhYTV9BY29yNDA
Can you now detect on video: darknet.exe detector demo data/voc.data yolo-voc.cfg yolo-voc.weights test.mp4


If nothing above does not work, then build OpenCV with cmake.

Should I change something in Visual Studio for the darknet to get vc14 folder instead of vc12?

Now in darknet-project used both vc14 and vc12 folders for lib. I think you should not change it.

Yesss, That worked, bingoo.

The file opencv_ffmpeg249_64.dll had existed in the vc12 folder, just copy-pasted it near darknet.exe and it worked. it is amazing why I was not getting any .dll absence error.

one thing I noticed is when I change the input video resolution of the camera/network camera, the darknet demo window size does not change, always it hold a fixed size.

I mean the window size changes when we test the stream in a web browser, but Darknet shows the same window size with whatever camera resolution.

This is true for a video file either.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zihaozhang9 picture zihaozhang9  路  3Comments

siddharth2395 picture siddharth2395  路  3Comments

kebundsc picture kebundsc  路  3Comments

louisondumont picture louisondumont  路  3Comments

hemp110 picture hemp110  路  3Comments