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.

Write on USB memory captured video data on OMAP L138

Other Parts Discussed in Thread: OMAPL138, OMAP-L138, THS7303, DA8XX

I want to capture video data from camera, connected in composite in and write it on connected USB.
How can I do it using VPIF driver in arago-linux, installed on OMAP L138 LCDK.
I found examples to capturing, using the following u-boot parameter: vpif_capture.ch0_bufsize=831488. How way I can stored captured data on USB? 

  • Can you please refer to the following TI wiki page ?
    processors.wiki.ti.com/.../OMAP-L138_running_Linux
    Also please consider to use the USB camera to OMAPL138 LCDK as you are running Linux on OMAPL138 (UVC driver is used for USB camera in LInux).
    You would get lot of reference application code to do your stuff.
  • Thanks, I've seen this demonstration, but I don't need in displaying captured video.
    I want to capture video and write capture data on USB memory stick.
    Do I correctly understand, that for capturing I should u-boot LSDK as how it describes here:
    processors.wiki.ti.com/.../OMAP-L1_Linux_Drivers_Usage
    with following bootargs: setenv bootargs console=ttyS2,115200n8 noinitrd rw ip=<ipaddr> root=/dev/nfs nfsroot=<nfs path> ,nolock
    mem=32M@0xc0000000 mem=64M@0xc4000000 vpif_capture.ch0_bufsize=692224?
    If my thoughts is correct, can I find a way to send captured data from capturing buffer on usb stick or captured it on stick at once?
  • It seems you have to encode the video frames to .mp4 or some other video format right ?
    Then you may have to use "mencoder" tool to encode the video and save to USB memory stick.
    "mplayer" would decode (play) the video data...

    Please refer to the following e2e post for cross compiling the mplayer and mencoder tools.
    e2e.ti.com/.../1215743
  • As I understand, mencoder allows convert video files in different formats. Before do it, I need to get inputstream from camera, connected through composite-in. But I don't understand, how do it. I've seen example with CMOS camera, connected to cam sensor: processors.wiki.ti.com/.../OMAP-L138_running_Linux
    I need to do same thing, but with another video-in on LSDK and without outputting it on LCD, and then I need to encode captured video stream and save it to USB
  • Hi Ilya,

    As far as "the saving into the USB" is concerned, these are the following things needed.

    1. As you said, you use linux, it has the USB mass storage driver as an inbuilt driver. using makemenuconfig, you have to enable the driver while building the kernel.

    Device Drivers --->
     SCSI device support --->
      --- SCSI device support
      [*] legacy /proc/scsi/support
      --- SCSI support type (disk, tape, CD-ROM)
      <*> SCSI disk support
     USB support --->
      <*> USB Mass Storage support

    2. Once you connect the USB storage device ( pen drive ) into the hardware platform of OMAPL138, the USB device will get detected and ready to communicate with the USB host controller of the OMAPL138. As the USB driver is also ready, you can use the USB device as you use it any other linux machines.

    3. For example, system() call uses a shell to execute the command. Some syntax given below.

    system("mkdir /media/usbstick");

    system("mount -t vfat /dev/sdb1 /media/usbstick");

    system("mount -t vfat /dev/sdb1 /media/usbstick");

    system(" /home/filename /media/usbstick/filename");

  • Thanks, I already fixed problem with usb.
    Main problem is capturing video data from composite-in:
    I'm bulding kernell with following video configurations in menuconfig:

    _________________________________________________________________________________
    System Type --->
    TI DaVinci Implementations --->
    [*] TI DA850/OMAP-L138/AM18xx Reference Platform
    Select peripherals connected to expander on UI board (Video Port Interface) --->

    Device Drivers --->
    <*> Multimedia support --->
    <*> Video For Linux
    [*] Video capture adapters --->
    <*> DaVinci Video VPIF Display
    <*> DaVinci Video VPIF Capture
    -*- DaVinci VPIF Driver
    [ ] Autoselect pertinent encoders/decoders and other helper chips
    Encoders/decoders and other helper chips --->
    <*> Texas Instruments TVP514x video decoder
    -*- THS7303 Video Amplifier
    -*- ADV7343 video encoder
    Device Drivers --->
    Graphics support --->
    < > DA8xx/OMAP-L1xx/AM1xxx Framebuffer support
    ________________________________________________________________________________

    Then I'm setting bootparams in u-boot for PAL capture and display: vpif_capture.ch0_bufsize=831488 vpif_display.ch2_bufsize=831488
    But when I'm trying to start PSP example for video capture, this programm can't found my analog cam, which connected to composite-in:
    _____________________________________________________
    root@omapl138-lcdk:~/vpif# ./vpif_mmap_loopback -m 1 -p 0
    Cannot open = /dev/video0 device
    Error in opening capture device for channel 0
    ____________________________________________________

    What I should to do to initialize my cam as /dev/video0. I've thought that it should be initialize automatically. Or not?