ni.com checkout is currently experiencing issues.
Support teams are actively working on the resolution.
ni.com checkout is currently experiencing issues.
Support teams are actively working on the resolution.
04-07-2015 02:27 PM
I am using a SOM (-9651), so arm7, LV LinuxRT 2014. I would like to connect a usb camera and have the image appear via a web page. I think mjpg-streamer or VLC will do that for me, but I can't find a repository where I can install either. Can someone point me to a repo? /dev/v4l and /dev/video0 appear when I plug the camera in, so I think the kernel has what I need. Other suggestions are welcome, if there is a simpler way. All we need is remote eyes on our process; no storage or processing. Thanks.
Matt
Solved! Go to Solution.
04-07-2015 02:37 PM
If you use NI-IMAQdx, it can natively capture from UVC webcams (which your camera appears to be if it shows up associated with the V4L support in the stock kernel).
You'd still have to do a bit of work (but it could be done in LabVIEW) if you wanted the image to be available via a webpage. I'd probably just make a web service that when run, acquires one image and returns it in a JPEG string. Then your web page could just refer to this web service's URL for the image.
Eric
04-07-2015 04:49 PM
Thanks Eric, I'll think about that approach. I was trying to avoid bringing the image through LV, mostly because I don't need to bring it in and the tools are available in Linux to do what I want, I just can't figure out how to install them. This will definitely be my fall back plan, though.
Matt
04-08-2015 09:22 AM
You have a couple of options:
I would personally do #2 but I'd recommend if you don't forsee the need to build a ton of packages, go with #1. In either case, do #3 to express your interest.
04-10-2015 09:06 AM
Hi Brad. Thanks. I started down the cross-compile route but decided to go native. My notes on what worked in case anyone else wants to do this, YMMV. Using a $20 Logitech webcam from the junk drawer, now streaming nicely.
Matt
Notes:
*2015.04.10 MRW notes on getting webcam stream running on -9651 SOM
*comments lines start with *
*confirm you get something like this in /var/log/messages:
*Apr 10 13:40:35 NI-sbRIO-9651-03074ebe kernel: [1808897.066695] usb 1-1.4: new high-speed USB device number 8 using xusbps-ehci
*Apr 10 13:40:36 NI-sbRIO-9651-03074ebe kernel: [1808897.415439] uvcvideo: Found UVC 1.00 device <unnamed> (046d:081b)
*Apr 10 13:40:36 NI-sbRIO-9651-03074ebe kernel: [1808897.531311] input: UVC Camera (046d:081b) as /devices/amba.0/e0003000.usb/xusbps-ehci.1/usb1/1-1/1-1.4/1-1.4:1.0/input/input3
*when you plug in your usb camera, specifically the 'UVC' part
ssh to SOM
opkg install packagegroup-core-buildessential
opkg install subversion
opkg install libjpeg-dev
opkg install coreutils
svn co https://svn.code.sf.net/p/mjpg-streamer/code/mjpg-streamer mjpg-streamer
*note mixed use of '-' and '_' in the following between mjpg and streamer
cd mjpg-streamer
make
make install
*this will install the following:
*install --mode=755 mjpg_streamer /usr/local/bin
*install --mode=644 input_uvc.so output_file.so output_udp.so output_http.so input_testpicture.so input_file.so /usr/*local/lib/
*install --mode=755 -d /usr/local/www
*install --mode=644 -D www/* /usr/local/www
*these are the files to be included in the deployment image
*edit /etc/config/mjpg_streamer
*config mjpg-streamer core
* option device "/dev/video0"
* option resolution "640x480"
* option fps "5"
* option port "58081"
* option enabled "true"
export LD_LIBRARY_PATH=/usr/local/lib
mjpg_streamer -i "input_uvc.so -d /dev/video0" -o "output_http.so -p 58081"
*from a browser on the network
http://192.168.11.81:58081/?action=stream
*cleanup - TBD; start with just 'opkg remove all_of_the_above'
04-10-2015 09:13 AM
Sounds good! Somehow I forgot to mention that one.
Is there already a /etc/ld.so.conf.d/local_libs.conf file? If so, you can fix the need to export LD_LIBRARY_PATH by simply re-running ldconfig.
04-10-2015 09:48 AM
There is an /etc/ld.so.conf.d/local_libs.conf file; thanks for the tip.
Matt