This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to get output of webcam through VGA port in OMAPL138 LCDK

Other Parts Discussed in Thread: OMAPL138

I am using OMAPL138LCDK i want to interface a USB webcam and display the output through the VGA port i have configured the UVC support through linux tool chain after which when i am connecting logitech webcam c270 it comes like below

***************************************************************

_____ _____ _ _ 
| _ |___ ___ ___ ___ | _ |___ ___ |_|___ ___| |_ 
| | _| .'| . | . | | __| _| . | | | -_| _| _|
|__|__|_| |__,|_ |___| |__| |_| |___|_| |___|___|_| 
|___| |___|

Arago Project http://arago-project.org omapl138-lcdk ttyS2

Arago 2011.09 omapl138-lcdk ttyS2

omapl138-lcdk login: root
root@omapl138-lcdk:~# usb 1-1: new full speed USB device number 2 using ohci
usb 1-1: New USB device found, idVendor=046d, idProduct=0825
usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=2
usb 1-1: SerialNumber: C1D14B60
uvcvideo: Found UVC 1.00 device <unnamed> (046d:0825)
input: UVC Camera (046d:0825) as /devices/platform/ohci.0/usb1/1-1/1-1:1.0/input/input0

after pressing enter i again comes to prompt

how to get the output of the camera to vga port display?

  • Hi,

    For capturing the image from V4L2 source:

    1) You have to download uvccapture source code and cross compile it,

    Here, You can capture the image only and not for streaming,

    For streaming the video from V4L2 source:

    2) You can stream the video output to VGA or LCD display through gst-launch command or "mplayer" command

    If mplayer, then you need to cross compile it,

    http://processors.wiki.ti.com/index.php/Mplayer

    If gst launch

    http://processors.wiki.ti.com/index.php/DM81xx_Gstreamer_Pipelines
    http://processors.wiki.ti.com/index.php/Example_GStreamer_Pipelines
    http://www.omappedia.com/wiki/Gstreamer_overview
    http://docs.gstreamer.com/display/GstSDK/gst-launch

    Note:

    choosing mplayer is the best option and good tool for streaming as well as good video/audio player(like VLC)  and little bit tough to re-compile and bringup,

  • Hi Vivek,

    I am here with attaching the cross compiled uvccapture utility for OMAPL138,

    5428.patch_uvccapture.tar.gz

    1) Mount your SD card into the system,

    2) Go to the second partition of SD card and untar the attached file there.

    ex:

    cd /media/rootfs

    tar -zxvf <location of downloaded pathc form link>

    tar -zxvf /home/titus/Desktop/patch_uvccapture.tar.gz

    3) Remove the SD card and boot the board.

    4) Connect the USB webcam and enter "uvccapture" command to capture the image from USB webcam

    5) You can find image file at current location

    I will update you If i able to cross compile the mplayer,

  • sir

    i have copied the patch_uvccapture.tar.gz in the rootfs folder after that i booted the SD card on kit through hyper terminal

    and

    after that i executed the  uvccapture command it comes like this below

    _____ _____ _ _
    _____ _____ _ _
    | _ |___ ___ ___ ___ | _ |___ ___ |_|___ ___| |_
    | | _| .'| . | . | | __| _| . | | | -_| _| _|
    |__|__|_| |__,|_ |___| |__| |_| |___|_| |___|___|_|
    |___| |___|

    Arago Project http://arago-project.org omapl138-lcdk ttyS2

    Arago 2011.09 omapl138-lcdk ttyS2

    omapl138-lcdk login: root
    Last login: Tue Apr 10 18:57:50 on ttyS2
    root@omapl138-lcdk:~# usb 1-1: new full speed USB device number 2 using ohci
    usb 1-1: New USB device found, idVendor=046d, idProduct=0825
    usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=2
    usb 1-1: SerialNumber: C1D14B60
    uvcvideo: Found UVC 1.00 device <unnamed> (046d:0825)
    input: UVC Camera (046d:0825) as /devices/platform/ohci.0/usb1/1-1/1-1:1.0/input/input0

    root@omapl138-lcdk:~# uvccapture
    -sh: uvccapture: not found
    root@omapl138-lcdk:~#

     

  • Hi,

    Please ensure that you have followed all the steps carefully,

    Cross check the "uvccapture" file is present at "/bin" location.

    Please Provide us the complete logs,

  • sir

    first i have copied the directory on rootfs 

    after i seen last post i did the following

    root@vivek-HP-Pavilion-g4-Notebook-PC:/# cd /media/vivek/rootfs/bin/
    root@vivek-HP-Pavilion-g4-Notebook-PC:/media/vivek/rootfs/bin# tar -zxvf /home/vivek/Desktop/omap/7651.patch_uvccapture.tar.gz
    patch_uvccapture/
    patch_uvccapture/bin/
    patch_uvccapture/bin/uvccapture
    patch_uvccapture/lib/
    patch_uvccapture/lib/libjpeg.so
    patch_uvccapture/lib/libjpeg.so.62
    root@vivek-HP-Pavilion-g4-Notebook-PC:/media/vivek/rootfs/bin# cd /
    root@vivek-HP-Pavilion-g4-Notebook-PC:/# sync
    root@vivek-HP-Pavilion-g4-Notebook-PC:/# umount /media/vivek/boot/
    root@vivek-HP-Pavilion-g4-Notebook-PC:/# umount /media/vivek/rootfs/
    root@vivek-HP-Pavilion-g4-Notebook-PC:/# umount /media/vivek/START_HERE/
    root@vivek-HP-Pavilion-g4-Notebook-PC:/# sync
    root@vivek-HP-Pavilion-g4-Notebook-PC:/#

    after that i booted the SD card on kit connected camera and executed uvccapture command and following happen

    ***************************************************************

    _____ _____ _ _
    | _ |___ ___ ___ ___ | _ |___ ___ |_|___ ___| |_
    | | _| .'| . | . | | __| _| . | | | -_| _| _|
    |__|__|_| |__,|_ |___| |__| |_| |___|_| |___|___|_|
    |___| |___|

    Arago Project http://arago-project.org omapl138-lcdk ttyS2

    Arago 2011.09 omapl138-lcdk ttyS2

    omapl138-lcdk login: root
    root@omapl138-lcdk:~# usb 1-1: new full speed USB device number 2 using ohci
    usb 1-1: New USB device found, idVendor=046d, idProduct=0825
    usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=2
    usb 1-1: SerialNumber: E6B6FD60
    uvcvideo: Found UVC 1.00 device <unnamed> (046d:0825)
    input: UVC Camera (046d:0825) as /devices/platform/ohci.0/usb1/1-1/1-1:1.0/input/input0
    root@omapl138-lcdk:~# uvccapture
    -sh: uvccapture: not found
    root@omapl138-lcdk:~#

  • Hi Vivek,

    Sorry I have problem with patch creation,

    Now download it and do the same procedure,

    2330.patch_uvccapture.tar.gz

    Let us know the status.

  • ok now i can take images through USB cam i fowwowed below

    root@vivek-HP-Pavilion-g4-Notebook-PC:/media/vivek/rootfs# tar -zxvf /home/vivek/Desktop/omap/5428.patch_uvccapture.tar.gz
    bin/
    bin/uvccapture
    lib/
    lib/libjpeg.so
    lib/libjpeg.so.62
    root@vivek-HP-Pavilion-g4-Notebook-PC:/media/vivek/rootfs# umount /media/vivek/START_HERE/
    root@vivek-HP-Pavilion-g4-Notebook-PC:/media/vivek/rootfs# umount /media/vivek/boot/root@vivek-HP-Pavilion-g4-Notebook-PC:/media/vivek/rootfs# 

    root@vivek-HP-Pavilion-g4-Notebook-PC:/media/vivek/rootfs# cd /
    root@vivek-HP-Pavilion-g4-Notebook-PC:/# umount /media/vivek/rootfs/
    root@vivek-HP-Pavilion-g4-Notebook-PC:/# sync

    booted the card i did the following

    Arago Project http://arago-project.org omapl138-lcdk ttyS2

    Arago 2011.09 omapl138-lcdk ttyS2

    omapl138-lcdk login: root
    root@omapl138-lcdk:~# usb 1-1: new full speed USB device number 2 using ohci
    usb 1-1: New USB device found, idVendor=046d, idProduct=0825
    usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=2
    usb 1-1: SerialNumber: E6B6FD60
    uvcvideo: Found UVC 1.00 device <unnamed> (046d:0825)
    input: UVC Camera (046d:0825) as /devices/platform/ohci.0/usb1/1-1/1-1:1.0/input/input0
    root@omapl138-lcdk:~# ls
    root@omapl138-lcdk:~# uvccapture
    root@omapl138-lcdk:~# ls
    snap.jpg

    inserted the card on host machine

    Got the image as in rootfs/home/root snap.jpg through web cam which is

    now how to stream it through VGA port display? 

  • Hi,

    Sounds good,

    I am working on cross compiling the mplayer and I will update you after i got success.

    mean while, Please try yourself also for cross compiling the mplayer or any other video player

    Try gst-launch also

  • Hi Vivek,

    I am able to cross compile the mplayer which is used for playing video/audio and streaming as well,

    I have tested  mplayer on TI OMAPL138 LCDK board.

    I have sent mplayer binary to your e-mail id which you mentioned at signature,

    Please let me know the status.

    For others:

    I am using MPlayer version is "MPlayer-1.1.1"

    Tool chain info:

    titus@titus-desktop:~/MPlayer-1.1.1$ arm-none-linux-gnueabi-gcc -v
    Using built-in specs.
    Target: arm-none-linux-gnueabi
    Configured with: /scratch/mitchell/builds/4.3-arm-none-linux-gnueabi-respin/src/gcc-4.3/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld --with-specs='%{funwind-tables|fno-unwind-tables|mabi=*|ffreestanding|nostdlib:;:-funwind-tables}' --enable-languages=c,c++ --enable-shared --enable-symvers=gnu --enable-__cxa_atexit --with-pkgversion='Sourcery G++ Lite 2009q1-203' --with-bugurl=https://support.codesourcery.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc --with-build-sysroot=/scratch/mitchell/builds/4.3-arm-none-linux-gnueabi-respin/lite/install/arm-none-linux-gnueabi/libc --with-gmp=/scratch/mitchell/builds/4.3-arm-none-linux-gnueabi-respin/lite/obj/host-libs-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-mpfr=/scratch/mitchell/builds/4.3-arm-none-linux-gnueabi-respin/lite/obj/host-libs-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --disable-libgomp --enable-poison-system-directories --with-build-time-tools=/scratch/mitchell/builds/4.3-arm-none-linux-gnueabi-respin/lite/install/arm-none-linux-gnueabi/bin --with-build-time-tools=/scratch/mitchell/builds/4.3-arm-none-linux-gnueabi-respin/lite/install/arm-none-linux-gnueabi/bin
    Thread model: posix
    gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203)
    titus@titus-desktop:~/MPlayer-1.1.1$

    Procedure to build

    1) Configuring:

    ./configure --prefix=/usr/local/filesystem_omapl138 --enable-cross-compile --cc=arm-none-linux-gnueabi-gcc --host-cc=gcc --as=arm-none-linux-gnueabi-as --ar=arm-none-linux-gnueabi-ar --ranlib=arm-none-linux-gnueabi-ranlib --target=arm-linux --disable-ivtv

    2) make

    3) Copy the mplayer builded binary to your filesystem.

  • Hi Vivek,

    You can copy the "mplayer" binary to rootfs partition of SD card,

    Change to execute permission.

    chmod 777 mplayer

    This is the command to get the video streaming from /dev/video0 (If USB webcam detected to /dev/video0)

    ./mplayer tv:// -tv device=/dev/videoX

    e.g.

    ./mplayer tv:// -tv device=/dev/video0

    Please Let us know the status.

  • | _ |___ ___ ___ ___ | _ |___ ___ |_|___ ___| |_
    | | _| .'| . | . | | __| _| . | | | -_| _| _|
    |__|__|_| |__,|_ |___| |__| |_| |___|_| |___|___|_|
    |___| |___|

    Arago Project http://arago-project.org omapl138-lcdk ttyS2

    Arago 2011.09 omapl138-lcdk ttyS2

    omapl138-lcdk login: root
    Last login: Tue Apr 10 19:57:09 on ttyS2
    root@omapl138-lcdk:~# ls
    snap.jpg
    root@omapl138-lcdk:~# cd /
    root@omapl138-lcdk:/# chmod 777 mplayer
    root@omapl138-lcdk:/# ./mplayer tv:// -tv device=/dev/video0
    MPlayer 1.1-4.6 (C) 2000-2012 MPlayer Team

    Playing tv://.
    TV file format detected.
    Selected driver: v4l2
    name: Video 4 Linux 2 input
    author: Martin Olschewski <olschewski@zpr.uni-koeln.de>
    comment: first try, more to come ;-)
    v4l2: your device driver does not support VIDIOC_G_STD ioctl, VIDIOC_G_PARM was used instead.
    Selected device: USB 2.0 Camera
    Capabilities: video capture streaming
    supported norms:
    inputs: 0 = Camera 1;
    Current input: 0
    Current format: MJPEG
    v4l2: ioctl set format failed: Invalid argument
    v4l2: ioctl set format failed: Invalid argument
    v4l2: ioctl set format failed: Invalid argument
    v4l2: ioctl set format failed: Invalid argument
    v4l2: ioctl set format failed: Invalid argument
    v4l2: ioctl set format failed: Invalid argument
    v4l2: ioctl set format failed: Invalid argument
    v4l2: ioctl set format failed: Invalid argument
    tv.c: norm_from_string(pal): Bogus norm parameter, setting default.
    v4l2: ioctl enum norm failed: Invalid argument
    Error: Cannot set norm!
    Selected input hasn't got a tuner!
    v4l2: ioctl set mute failed: Invalid argument
    ==========================================================================
    Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
    libavcodec version 54.23.100 (internal)
    Selected video codec: [ffmjpeg] vfm: ffmpeg (FFmpeg MJPEG)
    ==========================================================================
    Audio: no sound
    Starting playback...
    Could not find matching colorspace - retrying with -vf scale...
    Opening video filter: [scale]
    Movie-Aspect is undefined - no prescaling applied.
    [swscaler @ 0xb07338]No accelerated colorspace conversion found from yuv422p to rgb565le.
    [swscaler @ 0xb07338]using unscaled yuv422p -> rgb565le special converter
    VO: [fbdev] 640x480 => 640x480 BGR 16-bit
    V: 0.0 18/ 18 ??% ??% ??,?% 0 0


    MPlayer interrupted by signal 2 in module: decode_video
    V: 0.0 19/ 19 ??% ??% ??,?% 0 0
    v4l2: ioctl set mute failed: Invalid argument
    v4l2: 22 frames successfully processed, 63 frames dropped.

    Exiting... (Quit)

    i can see the video through vga port

      Thank u for support