Connecting Web Camera to A13-OLinuXino for video streaming


Image

In our previous blog post we setup demo where A13-OLinuXino-WIFI both was running web server with MOD-RGB control and at the same time was streaming video from Web Camera so you can see the result from the MOD-RGB control https://olimex.wordpress.com/2013/02/27/a13-olinuxino-serving-mod-rgb-and-web-cam-for-live-stream/

Here is description how the video streaming was done:

USB video cameras use UVC driver which is not enabled by default in A13-OLinuXino kernel so have to be enabled additionally.

  1. Installing UVC
  • # git clone https://github.com/linux-sunxi/linux-sunxi.git
  • # cd linux-sunxi
  • # make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- a13_defconfig;make ARCH=arm menuconfig
  • select in  Device Drivers -> Multimedia support -> Video capture adapters ->  V4L USB devices -> USB Video Class (UVC) (M)
  • # make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j5 uImage modules
  • # make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=output modules_install
  • # cp arch/arm/uImage /<sdcard mount point>/<FAT Partition>/.
  • # cp -aRv output/lib/modules/* /<sdcard mount point>/<EXT Partition>/lib/modules/.
  • # reboot
  • # modprobe uvcvideo

Now you have UVC support in your kernel and can use Web Camera for your Linux apps.

2.  Setup VLC Streaming

  • apt-get install vlc
  • # chmod 777 /dev/video*
  • # adduser vlc
  • # su vlc
  • # cvlc v4l2:// :v4l2-vdev=”/dev/video0″ :v4l-adev=”/dev/null” –sout
    ‘#transcode{vcodec=mpg1,vb=1024,vsize=320,hsize=240}:standard{access=http,mux=ogg,dst=:8080}’

last command is actually setting VLC streamer to stream mpg1 video 320×240 pixels at 8080 port, for more details check: http://wiki.videolan.org/

1 Comment (+add yours?)

  1. Erdem UYSAL
    Mar 16, 2013 @ 16:15:21

    Hi Olimex,
    Could you take a video for the installation of the UVC driver?
    I don’t understand which the platform is used.
    Also thank you so much for this topic.
    BR

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: