Go to Post The FIRST World has your back. - MishraArtificer [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 22-03-2015, 22:04
cbf cbf is offline
Registered User
FRC #2877
 
Join Date: Feb 2012
Location: Newton, MA
Posts: 74
cbf is just really nicecbf is just really nicecbf is just really nicecbf is just really nicecbf is just really nice
Re: mjpg-streamer running on roboRIO

It's worse than I thought. My earlier comparison was with the MJPG streamer at 10 fsp and my robot program at 24fps. The MJPG streamer uses about 3 times the bandwidth as the WPILib streamer running on the robot.

It looks like I'm getting an MJPEG stream from my Logitech P930e (similar to the Logitech P920 but with a wider field of view), rather than an H.264 stream.

Do you know if there's any way I can persuade input_uvc.so to get an H.264 or MPEG-4 stream from the camera?
  #17   Spotlight this post!  
Unread 22-03-2015, 22:06
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,032
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: mjpg-streamer running on roboRIO

Quote:
Originally Posted by cbf View Post
It's worse than I thought. My earlier comparison was with the MJPG streamer at 10 fsp and my robot program at 24fps. The MJPG streamer uses about 3 times the bandwidth as the WPILib streamer running on the robot.

It looks like I'm getting an MJPEG stream from my Logitech P930e (similar to the Logitech P920 but with a wider field of view), rather than an H.264 stream.

Do you know if there's any way I can persuade input_uvc.so to get an H.264 or MPEG-4 stream from the camera?
What quality setting are you using? That could affect it. (-q option). Also, I'm curious, what are you using to measure the bandwidth usage?
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
  #18   Spotlight this post!  
Unread 12-04-2015, 11:00
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,032
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: mjpg-streamer running on roboRIO

For anyone who wants to read data from mjpg-streamer, I've posted python code that can read from the stream using urllib + opencv.

http://www.virtualroadside.com/blog/...-using-opencv/

We ended up not using any image processing at our competition, but because our dashboard was created using HTML/js, it was trivially easy to connect to the camera and display its output. Highly recommend mjpg-streamer as a solution if you're only needing to display output on the Driver Station.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
  #19   Spotlight this post!  
Unread 12-04-2015, 14:39
cbf cbf is offline
Registered User
FRC #2877
 
Join Date: Feb 2012
Location: Newton, MA
Posts: 74
cbf is just really nicecbf is just really nicecbf is just really nicecbf is just really nicecbf is just really nice
Re: mjpg-streamer running on roboRIO

Quote:
Originally Posted by virtuald View Post
What quality setting are you using? That could affect it. (-q option). Also, I'm curious, what are you using to measure the bandwidth usage?
I believe I tried a few -q choices, but it was a while ago now.

I measured the bandwidth using the Windows task manager. Since there was nothing else on the WiFi between the laptop and the robot router (usual DLink 1522B), I believe the bandwidth measurements are reliable.
  #20   Spotlight this post!  
Unread 14-01-2016, 01:55
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,032
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: mjpg-streamer running on roboRIO

FYI, I packaged mjpg-streamer into an IPK file that can be installed by opkg. It includes an init script that automatically starts mjpg-streamer when the RoboRIO starts.

Installation: https://github.com/robotpy/roborio-packages
Notes: https://github.com/robotpy/roborio-p.../mjpg-streamer
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff

Last edited by virtuald : 14-01-2016 at 10:58. Reason: Bad URL
  #21   Spotlight this post!  
Unread 14-01-2016, 07:21
taichichuan's Avatar
taichichuan taichichuan is offline
Software Mentor
AKA: Mike Anderson
FRC #0116 (Epsilon Delta)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Herndon, VA
Posts: 328
taichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud of
Send a message via AIM to taichichuan
Re: mjpg-streamer running on roboRIO

Quote:
Originally Posted by virtuald View Post
FYI, I packaged mjpg-streamer into an IPK file that can be installed by opkg. It includes an init script that automatically starts mjpg-streamer when the RoboRIO starts.

Installation: https://github.com/robotpy/roborio-packages
Notes: https://github.com/robotpy/roborio-p.../mjpg-streamer
Thanks! This is a big help.

MikeA
FRC #116
  #22   Spotlight this post!  
Unread 14-01-2016, 18:57
team-4480's Avatar
team-4480 team-4480 is offline
Debug? What's that?
FRC #4480
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Minnesooota
Posts: 214
team-4480 will become famous soon enoughteam-4480 will become famous soon enough
Re: mjpg-streamer running on roboRIO

Quote:
Originally Posted by virtuald View Post
FYI, I packaged mjpg-streamer into an IPK file that can be installed by opkg. It includes an init script that automatically starts mjpg-streamer when the RoboRIO starts.

Installation: https://github.com/robotpy/roborio-packages
Notes: https://github.com/robotpy/roborio-p.../mjpg-streamer
I am trying to install it on our RIO, but I get this message: http://imgur.com/wzr8bJj

I did update to the latest version of RobotPy on the robot.

Thanks!
  #23   Spotlight this post!  
Unread 15-01-2016, 10:03
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,032
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: mjpg-streamer running on roboRIO

The opkg architecture has changed from 2015 to 2016, so if you don't have the 2016 image installed, then you will get that error.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
  #24   Spotlight this post!  
Unread 15-01-2016, 10:17
team-4480's Avatar
team-4480 team-4480 is offline
Debug? What's that?
FRC #4480
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Minnesooota
Posts: 214
team-4480 will become famous soon enoughteam-4480 will become famous soon enough
Re: mjpg-streamer running on roboRIO

Quote:
Originally Posted by virtuald View Post
The opkg architecture has changed from 2015 to 2016, so if you don't have the 2016 image installed, then you will get that error.
Oh yea, I still have to update. So once I get it installed, do I just plug in the webcam and I will see it on the driver station? Or is there some other setup I have to do yet?
  #25   Spotlight this post!  
Unread 15-01-2016, 10:20
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,032
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: mjpg-streamer running on roboRIO

I haven't tried to integrate mjpg-streamer with the LabVIEW dashboard (and it's not really something I'm planning to do).

To see the camera feed, point a web browser at http://roborio-4480-frc.local:5800/ and it should show up there. If it doesn't, then reboot your roboRIO with the camera plugged in.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
  #26   Spotlight this post!  
Unread 15-01-2016, 10:28
team-4480's Avatar
team-4480 team-4480 is offline
Debug? What's that?
FRC #4480
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Minnesooota
Posts: 214
team-4480 will become famous soon enoughteam-4480 will become famous soon enough
Re: mjpg-streamer running on roboRIO

Quote:
Originally Posted by virtuald View Post
I haven't tried to integrate mjpg-streamer with the LabVIEW dashboard (and it's not really something I'm planning to do).

To see the camera feed, point a web browser at http://roborio-4480-frc.local:5800/ and it should show up there. If it doesn't, then reboot your roboRIO with the camera plugged in.
Awesome! Is it possible to connect two cameras with this or would that eat up too much bandwidth?
  #27   Spotlight this post!  
Unread 15-01-2016, 11:16
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,032
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: mjpg-streamer running on roboRIO

Quote:
Originally Posted by team-4480 View Post
Awesome! Is it possible to connect two cameras with this or would that eat up too much bandwidth?
This package supports launching up to 4 instances of mjpg streamer (the second would be at :5801 instead of :5800). You'll need to edit /etc/default/mjpg-streamer on the roborio, followed by '/etc/init.d/mjpg-streamer restart' or a robot reboot to enable this.

Refer to the FMS Whitepaper for bandwidth approximations. Last year we were able to run two 120x160 streams at 10fps with no complaints from the FTAA (we doubled the display size of the image on our HTML dashboard).
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
  #28   Spotlight this post!  
Unread 15-01-2016, 11:47
team-4480's Avatar
team-4480 team-4480 is offline
Debug? What's that?
FRC #4480
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Minnesooota
Posts: 214
team-4480 will become famous soon enoughteam-4480 will become famous soon enough
Re: mjpg-streamer running on roboRIO

Quote:
Originally Posted by virtuald View Post
This package supports launching up to 4 instances of mjpg streamer (the second would be at :5801 instead of :5800). You'll need to edit /etc/default/mjpg-streamer on the roborio, followed by '/etc/init.d/mjpg-streamer restart' or a robot reboot to enable this.

Refer to the FMS Whitepaper for bandwidth approximations. Last year we were able to run two 120x160 streams at 10fps with no complaints from the FTAA (we doubled the display size of the image on our HTML dashboard).
I am not able to see the page, firefox just says unable to connect when I try "roborio-4480-frc.local:5800". I did reboot so I am wondering if the config file is off because I set it up over USB using 172.... instead of Wifi. I imagine there is a setting in the config file, but I don't know how to get into it since my favorite editor is not installed(nano).
  #29   Spotlight this post!  
Unread 15-01-2016, 12:23
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,032
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: mjpg-streamer running on roboRIO

Quote:
Originally Posted by team-4480 View Post
I am not able to see the page, firefox just says unable to connect when I try "roborio-4480-frc.local:5800". I did reboot so I am wondering if the config file is off because I set it up over USB using 172.... instead of Wifi. I imagine there is a setting in the config file, but I don't know how to get into it since my favorite editor is not installed(nano).
To diagnose you'll need to SSH into the roborio (user: admin, password: just hit enter).
  • Does /dev/video0 exist? If not, then your camera isn't recognized by the roboRIO and mjpg-streamer won't be running. You can use 'dmesg' to look at the kernel messages and try to divine what happened. Not all cameras will be supported -- but I'm not 100% sure what ones are supported, or how to get the list (probably some linux magic)
  • Is mjpg-streamer running or did it die? "ps -Af | grep mjpg" will show you
  • If it's running, is it listening on the right port? "netstat -ln" can show you what ports are being listened on, 5800 should be in the list.
  • If /dev/video0 exists and mjpg-streamer dies, then there's something else wrong and you'll need to run mjpg-streamer on the command line. Unfortunately, I haven't put anything in the package to do this using the settings, so it's a bit verbose...
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
  #30   Spotlight this post!  
Unread 15-01-2016, 12:32
team-4480's Avatar
team-4480 team-4480 is offline
Debug? What's that?
FRC #4480
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Minnesooota
Posts: 214
team-4480 will become famous soon enoughteam-4480 will become famous soon enough
Re: mjpg-streamer running on roboRIO

Quote:
Originally Posted by virtuald View Post
To diagnose you'll need to SSH into the roborio (user: admin, password: just hit enter).
  • Does /dev/video0 exist? If not, then your camera isn't recognized by the roboRIO and mjpg-streamer won't be running. You can use 'dmesg' to look at the kernel messages and try to divine what happened. Not all cameras will be supported -- but I'm not 100% sure what ones are supported, or how to get the list (probably some linux magic)
  • Is mjpg-streamer running or did it die? "ps -Af | grep mjpg" will show you
  • If it's running, is it listening on the right port? "netstat -ln" can show you what ports are being listened on, 5800 should be in the list.
  • If /dev/video0 exists and mjpg-streamer dies, then there's something else wrong and you'll need to run mjpg-streamer on the command line. Unfortunately, I haven't put anything in the package to do this using the settings, so it's a bit verbose...
Alright, so there is video zero

With the "ps -Af | grep mjpg", I get
Code:
1602 admin {grep} /bin/busybox.nosuid /bin/grep mjpg
There is not 5800 on the port list

Thanks for all the support!
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 12:33.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi