Unable to get this streaming with a Hikvision mjpeg stream

5,178 views
Skip to first unread message

jimt...@gmail.com

unread,
May 8, 2017, 2:51:17 PM5/8/17
to OpenALPR
I've been fishing around trying to get this to work, here is my current setup:

1) I have a Hikvision camera.  I've set its substream to be mjpeg as shown in this image...


2) I tested this stream in VLC, by connecting to the following network stream: http://admin:P455...@10.120.111.244/Streaming/Channels/2/preview.  No issues there, streaming correctly.

3) I modified alprd.conf with the following line: stream = http://admin:P455...@10.120.111.244/Streaming/Channels/2/preview

4) I ran alprd, to no avail...First on MacOS:

./alprd -f --config ./config/
INFO - Running OpenALPR daemon in the foreground.
INFO - Using: ./config/alprd.conf for daemon configuration
Missing config value for company_id
Missing config value for pattern
INFO - Using: /var/lib/openalpr/plateimages/ for storing valid plate images
INFO - country: us -- config file: ./config/openalpr.conf
INFO - pattern:
INFO - Stream 1: http://admin:P455...@10.126.141.204/Streaming/Channels/2/preview
INFO - Starting camera 1
INFO - Video stream connecting...
VIDEOIO(cvCreateFileCapture_AVFoundation (filename)): raised unknown C++ exception!
WARN - Stream http://admin:P455...@10.126.141.204/Streaming/Channels/2/preview?openalprfiletype=file.mjpg failed to open.
INFO - Video stream connecting...
VIDEOIO(cvCreateFileCapture_AVFoundation (filename)): raised unknown C++ exception!

And then again on a fresh Ubuntu install:

INFO - Running OpenALPR daemon in the foreground.
INFO - Using: /etc/openalpr/alprd.conf for daemon configuration
INFO - Using: /var/lib/openalpr/plateimages/ for storing valid plate images
INFO - country: us -- config file: /etc/openalpr/openalpr.conf
INFO - Stream 1: http://admin:P455...@10.126.141.204/Streaming/Channels/2/preview
INFO - Starting camera 1
INFO - Video stream connecting...
WARN - Stream http://admin:P455...@10.126.141.204/Streaming/Channels/2/preview?openalprfiletype=file.mjpg failed to open.

What am I doing wrong here?  I'm simply trying to get the alprd daemon running against my Hikvision camera stream.  Thanks for any help you can provide!

jimt...@gmail.com

unread,
May 24, 2017, 3:33:59 PM5/24/17
to OpenALPR
Anybody?


On Monday, May 8, 2017 at 2:51:17 PM UTC-4, jimt...@gmail.com wrote:
I've been fishing around trying to get this to work, here is my current setup:

1) I have a Hikvision camera.  I've set its substream to be mjpeg as shown in this image...


2) I tested this stream in VLC, by connecting to the following network stream: http://admin:P455w0rd@10.120.111.244/Streaming/Channels/2/preview.  No issues there, streaming correctly.

Bara Muse

unread,
May 25, 2017, 12:54:53 AM5/25/17
to OpenALPR
Hi,

you're not doing anything wrong, it's in the daemon code :  it appends "?openalprfiletype=file.mjpg" when it tries to open an http video stream source that does not already have an .mjpg extension.
Apparently to help OpenCV.

I tried to work around that previously, change the code, recompile... but i ended trying to get OpenCV handle the rtsp stream instead as the MJPG streams are getting rare now.
And it works pretty well, but with a newer version of OpenCV, I don't know which one you use.

I spent a few days  compiling OpenCV 3.2 from source with the modules (ffmpeg, gstreamer, OpenCL etc..) with OpenALPR 2.3 and it works like a charm with x264 rtsp streams now.

VIJAY GURJAR

unread,
Jul 9, 2018, 2:19:52 AM7/9/18
to OpenALPR
Try to stream using RTSP protocol

syntax: rtps://username:password@ipaddres:rtspport(default 554)

Example : rtsp://admin:admin%40...@192.168.1.1:554


On Tuesday, May 9, 2017 at 12:21:17 AM UTC+5:30, jimt...@gmail.com wrote:
I've been fishing around trying to get this to work, here is my current setup:

1) I have a Hikvision camera.  I've set its substream to be mjpeg as shown in this image...


2) I tested this stream in VLC, by connecting to the following network stream: http://admin:P455w0rd@10.120.111.244/Streaming/Channels/2/preview.  No issues there, streaming correctly.

Nigel Andam

unread,
Dec 4, 2018, 10:06:44 PM12/4/18
to OpenALPR
Hello, what kind of camera is this? LPR or just IP camera?

Can I use the OpenALPR Daemon without using Cloud Stream? Just python Integration?

Please reply I need your help

On Tuesday, 9 May 2017 02:51:17 UTC+8, jimt...@gmail.com wrote:
I've been fishing around trying to get this to work, here is my current setup:

1) I have a Hikvision camera.  I've set its substream to be mjpeg as shown in this image...


2) I tested this stream in VLC, by connecting to the following network stream: http://admin:P455w0rd@10.120.111.244/Streaming/Channels/2/preview.  No issues there, streaming correctly.

Markus Stoltz

unread,
Jan 18, 2019, 8:25:50 AM1/18/19
to OpenALPR
Hi There.

I'd like to stream from a Hikvision to OpenALPR as well, using MPEG, but just found your thread. Have you resolved this? With RTSP or MJPEG?

Regards
Markus


On Monday, May 8, 2017 at 8:51:17 PM UTC+2, jimt...@gmail.com wrote:
I've been fishing around trying to get this to work, here is my current setup:

1) I have a Hikvision camera.  I've set its substream to be mjpeg as shown in this image...


2) I tested this stream in VLC, by connecting to the following network stream: http://admin:P455w0rd@10.120.111.244/Streaming/Channels/2/preview.  No issues there, streaming correctly.

Matthew Mason

unread,
May 29, 2019, 7:41:20 PM5/29/19
to OpenALPR
Bara-
I am interested in how you were able to get OpenCV to handle the RTSP stream.  Do you still have access to the code or documentation?  I am hoping to be able to implement a similar application on my device and would appreciate any assistance you could provide.  Thanks!

M
Reply all
Reply to author
Forward
0 new messages