2011年4月8日 星期五

Beagleboard xM - Camera board

延續之前 DVSDK ,接著來看DSP Multimedia的應用

1.Beagleboard XM camera board
Leopard imaging inc 有一系列camera board支援BeagleBoard XM.
https://www.leopardimaging.com/Beagle_Board_xM_Camera.html\



有1.3M / 3M / 5M (百萬畫素) 鏡頭.其中 1.3M / 3M camera board 在 DVSDK 上已有driver.
我手邊有 LI-LBCM3M1 三百萬畫素 CMOS sensor mt9t111 (相容 mt9t112), DVSDK PSP linux已經包含mt9t112 driver.
載入camera driver需要修改bootloader 環境變數.
首先將SD card 連接至PC, 新增檔案BOOT/boot_dvi_lbcm3m1.cmd 如下

setenv bootargs 'console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw ip=off mem=55M@0x80000000 mpurate=1000  omap_vout.vid1_static_vrfb_alloc=y omapfb.vram=0:8M mem=384M@0x88000000 omapfb.mode=dvi:hd720 omapdss.def_disp=dvi rootwait vram=8M camera=lbcm3m1'
fatload mmc 0 80200000 uImage
bootm 80200000

接著產生 boot_dvi_lbcm3m1.scr

gigijoe@gigijoe-laptop:/media/BOOT$ mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n 'Execute Boot Script' -d boot_dvi_lbcm3m1.cmd boot_dvi_lbcm3m1.scr
Image Name:   Execute Boot Script
Created:      Tue Mar 29 20:19:04 2011
Image Type:   ARM Linux Script (uncompressed)
Data Size:    304 Bytes = 0.30 kB = 0.00 MB
Load Address: 0x00000000
Entry Point:  0x00000000
Contents:
   Image 0:      296 Bytes =    0 kB = 0 MB

增加camera=lbcm3m1,使相對應的driver會被自動載入.

root@beagleboard-dvsdk:~# lsmod
Module                  Size  Used by
sdmak                   3759  0
lpm_omap3530            6537  0
dsplinkk              124358  1 lpm_omap3530
cmemk                  21358  0
bufferclass_ti          4838  0
omaplfb                 8770  0
pvrsrvkm              129682  2 bufferclass_ti,omaplfb
ipv6                  249320  14
rtc_twl                 4263  0
rtc_core               12531  1 rtc_twl
mt9t112                 9329  0

2.Test camera board
首先先測試camera影像是否正常,最方便的方式是使用DVSDK built-in gstreamer
Camera device node 是 /dev/video0

gst-launch v4l2src always_copy=FALSE ! video/x-raw-yuv,width=640,height=480 ! queue max-size-buffers=8000 max-size-time=0 max-size-bytes=0 ! TIDmaiVideoSink videoStd=720P_60 videoOutput=AUTO numBufs=5

應該會在DVI output上看到影像



3.Play with camera board

現在來看實際上的應用,場景是將Camera board得到的影像透過DSP 壓縮成H.264格式,接著以RTP H.264封裝透過網路傳送到PC端,接著PC端將影像解壓縮並顯示在銀幕上

BeagleBoard XM : 192.168.168.89

gst-launch v4l2src always_copy=FALSE ! video/x-raw-yuv,width=640,height=480 ! queue max-size-buffers=8000 max-size-time=0 max-size-bytes=0 ! TIVidenc1 codecName=h264enc engineName=codecServer ! rtp264pay pt=96 ! multiudpsink client="192.168.168.56:1234"

PC : 192.168.168.56

gst-launch udpsrc port=1234 caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264" ! gstrtpjitterbuffer latency=100 ! rtph264depay ! ffdec_h264 ! xvimagesink



沒有留言:

張貼留言