|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#61
|
||||
|
||||
|
Re: mjpg-streamer running on roboRIO
To connect to an mjpg stream with OpenCV's VideoCapture object, OpenCV needs to have libav/ffmpeg support compiled in. The version of OpenCV that I distribute does not currently have libav support (see issue #2). That's interesting that you were able to connect to an Axis camera, as that would also require libav.
When running the code on the RoboRIO, you should be able to use this URL: http://localhost:5800/?action=stream EDIT: It's possible that OpenCV 3.x does not require libav to connect to an mjpg stream.. but I know OpenCV 2 did require it. If you're connecting to the stream separately then that's would work too. Last edited by virtuald : 15-02-2016 at 13:57. |
|
#62
|
||||
|
||||
|
Re: mjpg-streamer running on roboRIO
Quote:
EDIT: So, is there an issue with linking libav to opencv? Also, I had an axis camera working on opencv 2.4.10, not 3.0. Maybe this will help you? So, running the vision code with mjpg streamer on the roboRIO is out of the question at the moment? If so, would the next logical step to have vision run on the driver station computer? If so, how would I go about doing that? Thanks again, Drew Last edited by jreneew2 : 15-02-2016 at 14:16. |
|
#63
|
||||
|
||||
|
Re: mjpg-streamer running on roboRIO
Quote:
When I say "separately", I mean roll your own code to make the HTTP connection. Like this python code. It's pretty easy in python because it's fairly easy to create http connections... I'm not sure what I would use in C++, it's been too long. FWIW, the last time that I used OpenCV to connect to an mjpg stream (an Axis, actually) via ffmpeg, I ran into this bug: https://trac.ffmpeg.org/ticket/2343 |
|
#64
|
||||
|
||||
|
Re: mjpg-streamer running on roboRIO
Heh, mjpg-streamer has an HTTP input plugin which reads images from another mjpg-streamer instance. You could grab that code and use it to read from the stream, it seems to be pretty simple.. though, it is GPL so if you used it your code would automatically become GPL too.
|
|
#65
|
|||
|
|||
|
Re: mjpg-streamer running on roboRIO
I was able to install the mjpg streamer without issue, works great. The issue (well not really issue more of question) is: Is there a good way to check overall bandwidth usage. I have camera 1 running through Labview for vision tracking and camera 2 running through the streamer. I can adjust the frame rate, resolution, etc, but I want as high as possible without getting into the danger zone. For what we have planned for the 2nd camera even 1 or 2 frames a second is sufficient but I'd prefer it as high res as I can get it.
|
|
#66
|
|||
|
|||
|
Re: mjpg-streamer running on roboRIO
Quote:
|
|
#67
|
||||
|
||||
|
Re: mjpg-streamer running on roboRIO
Quote:
Are you trying to access the cameras from mjpg-streamer and another app (like the robot code)? That won't work, I think you can only access a camera from a single app at a time. |
|
#68
|
|||
|
|||
|
Re: mjpg-streamer running on roboRIO
Quote:
UPDATE: It seems to be working fine now. I post again if we have problems Last edited by NegaNexus : 15-02-2016 at 18:15. Reason: update on issues |
|
#69
|
|||
|
|||
|
Re: mjpg-streamer running on roboRIO
In case anyone is running 2 cameras and wants a convenient way to switch between them, I have a forked branch of the SmartDashboard plugin that allows it. It also has the ability to add a simple "crosshair" circle from SD.
https://github.com/RobotCasserole173...am_SDExtension |
|
#70
|
||||
|
||||
|
Re: mjpg-streamer running on roboRIO
FYI, I created an OpenCV 3.x input plugin for mjpg-streamer that allows you to capture from OpenCV and filter the input via a separate plugin. More information on github. And of course, there's a filter plugin that comes with it that allows you to write a python 3 script and use that as a filter, or you can write your own in C++.
Haven't done much testing with it, but it seems to work on my desktop. I have not pushed a working build into roborio-packages yet... I have packaging setup for it, but want to test it on the RoboRIO first. Will do that tonight. |
|
#71
|
|||
|
|||
|
Re: mjpg-streamer running on roboRIO
What we ended up doing is running mjpg as well as an ip camera. 2 cameras at once just wasn't gonna happen no matter how much we throttled the fps and resolution. We ended up with a nice system of a single ip camera (Axis) and a generic 180 degree camera we got on Amazon. Pictures are excellent and we have a very good field of view. There is a 1/2 a second or so lag which the driver had to get used to though.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|