6 Replies Latest reply on Jan 27, 2016 11:46 AM by BMEJ

    Intel Galileo Gen2 - USB Camera

    IDn1984

      hi,

       

      i'm a student and i need to connect and stream a USB camera to my Galileo Gen2, in the guides that i found i have to change my OS to debian but i don't really know how to do it since i'm not linux expert, can some one help me or know a good manual for streaming video from USB camera via Galileo?

       

      currently i have YOCTO on my Galileo

       

      thanks

      Idan

        • 1. Re: Intel Galileo Gen2 - USB Camera
          PabloM_Intel

          Hi IDn1984,

           

          I haven’t done this before, but if you don’t want to do this using the Yocto image you will need to follow some steps. Also, which image are you currently using? The IoT image or the standard image?

          1. First you should check that your webcam or the device that you’ll be using to do the streaming is UVC compatible, you can check a list of UVC compatible devices in here http://www.ideasonboard.org/uvc/.
          2. Apply power to your Galileo board and connect the USB webcam to the USB port of the board.
          3. Check if the UVC driver is already installed, enter: find /lib/modules/* -name ‘uvc’. If nothing is returned it will be necessary to install the UVC driver manually. Let us know if you’re having trouble with this.
          4. Verify that the UVC driver is loaded and that the webcam is detected properly. Plug your board and type: lsmod | grep uvc. What output do you get?
          5. Verify that the video device node has been created by typing: ls –l /dev/video0. What output do you get?
          6. Download ffmpeg (this is a free software that produces libraries and programs for handling multimedia data).


          1. To capture video - Execute the command: <full path>/ffmpeg -s 320x240 -f video4linux2 -i /dev/video0 \ -f mpeg1video -b 800k -r 30 myVideo.mpeg. After some seconds, press q to stop capturing. Copy the file myVideo.mpeg to a PC and check the video.
          2. For web streaming I would suggest you to check these links for examples:

           

          Regards,

          PabloM_Intel

          1 of 1 people found this helpful
          • 2. Re: Intel Galileo Gen2 - USB Camera
            IDn1984

            thanks,

             

            i will try it,

            • 3. Re: Intel Galileo Gen2 - USB Camera
              IDn1984

              we are using YOCTO standard ,

               

              1. First you should check that your webcam or the device that you’ll be using to do the streaming is UVC compatible, you can check a list of UVC compatible devices in here http://www.ideasonboard.org/uvc/. --done and its in the list (luvc)
              2. Apply power to your Galileo board and connect the USB webcam to the USB port of the board.
              3. Check if the UVC driver is already installed, enter: find /lib/modules/* -name ‘uvc’. If nothing is returned it will be necessary to install the UVC driver manually. Let us know if you’re having trouble with this. -- run the command and found the uvc drivers
              4. Verify that the UVC driver is loaded and that the webcam is detected properly. Plug your board and type: lsmod | grep uvc. What output do you get?
                1. cd /lib/modules/**os version**/
                2. cat modules.dep | grep -i uvc (finding the uvc drivers)
                3. modprobe uvcvideo (loading the driver)
                4. lsmod | grep uvc (driver status)
                5. ls -l /dev/video0/ (verified that video0 folder has been created)

              5. Verify that the video device node has been created by typing: ls –l /dev/video0. What output do you get? -- we verified that video0 folder has been created
              6. Download ffmpeg (this is a free software that produces libraries and programs for handling multimedia data).-- done


              • To capture video - Execute the command: <full path>/ffmpeg -s 320x240 -f video4linux2 -i /dev/video0 \ -f mpeg1video -b 800k -r 30 myVideo.mpeg. After some seconds, press q to stop capturing. Copy the file myVideo.mpeg to a PC and check the video.


              • ******we managed to run the ffmpeg command as you mentioned, it start to proccesing but than after few seconds we are getting "Illegal instruction" error, we can find the file but i doesn't work and 7k size,

               

               

              LOG:

              sh-4.2# /media/mmcblk0p1/ffmpeg-release-32bit-static/ffmpeg-2.8.2-32bit-static/ffmpeg -s 320x240 -f video4linux2 -i /dev/video0 \-f mpeg1video -b 800k -r 30 myvideo.mpeg

              ffmpeg version 2.8.2-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2015 the FFmpeg developers

                built with gcc 5.2.1 (Debian 5.2.1-23) 20151028

                configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --enable-frei0r --enable-libfribidi --disable-indev=sndio --disable-outdev=sndio --cc=gcc

                libavutil      54. 31.100 / 54. 31.100

                libavcodec     56. 60.100 / 56. 60.100

                libavformat    56. 40.101 / 56. 40.101

                libavdevice    56.  4.100 / 56.  4.100

                libavfilter     5. 40.101 /  5. 40.101

                libswscale      3.  1.101 /  3.  1.101

                libswresample   1.  2.101 /  1.  2.101

                libpostproc    53.  3.100 / 53.  3.100

              Input #0, video4linux2,v4l2, from '/dev/video0':

                Duration: N/A, start: 1605.943030, bitrate: 36864 kb/s

                  Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 320x240, 36864 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc

              Please use -b:a or -b:v, -b is ambiguous

              Output #0, mpeg1video, to 'myvideo.mpeg':

                Metadata:

                  encoder         : Lavf56.40.101

                  Stream #0:0: Video: mpeg1video, yuv420p, 320x240, q=2-31, 800 kb/s, 30 fps, 30 tbn, 30 tbc

                  Metadata:

                    encoder         : Lavc56.60.100 mpeg1video

              Stream mapping:

                Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg1video (native))

              Press [q] to stop, [?] for help

              Illegal instruction

               

               

               

              if you have any idea it will be great,

               

              thanks,

              Idan

              • 4. Re: Intel Galileo Gen2 - USB Camera
                PabloM_Intel

                Hi IDn1984,

                 

                One thing that you could try is to install ffmpeg from the AlexT repo? Do you have your board configured to fetch packages from his repository? If not, you can follow the instructions in here http://alextgalileo.altervista.org/package-repo-configuration-instructions.html.

                You can also test with the IoT image, as it has some additional packages.

                 

                It's also possible that the Galileo lacks the power to accomplish this.

                 

                Regards,

                PabloM_Intel

                • 5. Re: Intel Galileo Gen2 - USB Camera
                  rgb

                  There have been a few discussions about using USB Webcams with the Galileo, you can do  a search on the word webcam.

                  One is here Can anyboby tell me a detailed step by step guide to connect webcam to intel galileo gen 2?

                  and there was an instructable made at Streaming USB Webcam with the Intel Galileo Gen 2

                  I found it best to use AlexT's distribution of Yoto as has the files so can easily install

                  Hope this helps

                  rgb

                  • 6. Re: Intel Galileo Gen2 - USB Camera
                    BMEJ

                    PabloM_Intel wrote:

                     

                     


                    1. To capture video - Execute the command: <full path>/ffmpeg -s 320x240 -f video4linux2 -i /dev/video0 \ -f mpeg1video -b 800k -r 30 myVideo.mpeg. After some seconds, press q to stop capturing. Copy the file myVideo.mpeg to a PC and check the video.
                    2. For web streaming I would suggest you to check these links for examples:

                     

                    Regards,

                    PabloM_Intel

                    Thanks for these steps Pablo,

                     

                    I am using the iot linux Yocto full image.

                     

                    I do see my webcam as listed and I followed these steps but i get this error:    unable to find -f

                     

                    root@galileo:/home/ffmpg/ffmpeg-2.8.5-32bit-static# /home/ffmpg/ffmpeg-2.8.5-32bit-static/ffmpeg -s 320x240 -f video4linux2 -i /dev/video0 \ -f mpeg1video -b 800k -r 30 myVideo.mpeg

                    ffmpeg version 2.8.5-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2016 the FFmpeg developers

                      built with gcc 4.9.3 (Debian 4.9.3-10)

                      configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --enable-frei0r --enable-libfribidi --disable-indev=sndio --disable-outdev=sndio --cc=gcc-4.9

                      libavutil      54. 31.100 / 54. 31.100

                      libavcodec     56. 60.100 / 56. 60.100

                      libavformat    56. 40.101 / 56. 40.101

                      libavdevice    56.  4.100 / 56.  4.100

                      libavfilter     5. 40.101 /  5. 40.101

                      libswscale      3.  1.101 /  3.  1.101

                      libswresample   1.  2.101 /  1.  2.101

                      libpostproc    53.  3.100 / 53.  3.100

                    Input #0, video4linux2,v4l2, from '/dev/video0':

                      Duration: N/A, start: 3063.888372, bitrate: 36864 kb/s

                        Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 320x240, 36864 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc

                    [NULL @ 0xb440d60] Unable to find a suitable output format for ' -f'

                    -f: Invalid argument

                     

                     

                    any ideas?

                     

                    Thanks