DM36x component input and live preview hdmi output - Gstreamer pipelines

From RidgeRun Developer Connection
Jump to: navigation, search

Introduction

Live streaming can be done on DM368 Leopardboard hardware using LI-HDI365 for component video in and LI-DVI1 for HDMI output with the GStreamer pipelines documented below. RidgeRun offers a pre-built bootable SD card image you can use or you can configure your RidgeRun evaluation or professional SDK to build the image yourself.

References

DM36x LeopardBoard Hardware_setup

Note

While on boot you will get RidgeRun logo on the monitor.

Enabling video window

When you boot, the OSD (on screen display) called as frame buffer, has priority for the video output. To enable the video window to be visible, you need to run:

fbset -disable

720p HDMI output pipelines

Pipeline 1 - Testing using 'videotestsrc'

gst-launch -v videotestsrc !video/x-raw-yuv,width=1280,height=720 ! TIDmaiVideoSink videoStd=720P_60 videoOutput=DVI accelFrameCopy=FALSE sync=false

Pipeline 2 - 720P HDMI Output recording.

H264ENC_PARMS="encodingpreset=2 ratecontrol=2 intraframeinterval=23 idrinterval=46 targetbitrate=1000000 profile=100 level=50 entropy=1 t8x8inter=true t8x8intra=true single-nalu=true"

gst-launch v4l2src always-copy=FALSE input-src=component chain-ipipe=true num-buffers=2000 ! 'video/x-raw-yuv,format=(fourcc)NV12,width=1280,height=720' ! \ 
           dmaiaccel ! dmaienc_h264 $H264ENC_PARMS ! queue ! dmaiperf print-arm-load=true ! qtmux ! queue ! filesink location=test.mp4 sync=false enable-last-buffer=false

Pipeline 3 - Live preview 720P HDMI Output recording and playing on the tv monitor.

H264ENC_PARMS="encodingpreset=2 ratecontrol=2 intraframeinterval=23 idrinterval=46 targetbitrate=1000000 profile=100 level=50 entropy=1 t8x8inter=true t8x8intra=true single-nalu=true"

gst-launch v4l2src input-src=component chain-ipipe=true always-copy=false num-buffers=2000 ! 'video/x-raw-yuv,format=(fourcc)NV12,width=1280,height=720' ! dmaiaccel ! \
           tee name=t1 ! TIDmaiVideoSink enable-last-buffer=false videoStd=720P_60 videoOutput=DVI t1. ! queue ! dmaienc_h264 $H264ENC_PARMS ! queue ! dmaiperf print-arm-load=true ! \ 
           qtmux ! queue ! filesink location=test.mp4 sync=false enable-last-buffer=false

fps measured is 40 and Armload is 20

1080p HDMI output Pipelines

Pipeline 1 - Testing using 'videotestsrc'

gst-launch -v videotestsrc !video/x-raw-yuv,width=1920,height=1080 ! TIDmaiVideoSink videoStd=1080P_25 videoOutput=DVI accelFrameCopy=FALSE sync=false

Pipeline 2a - 1080p hdmi output playing on the TV Monitor

gst-launch -v v4l2src always-copy=false input-src=component ! 'video/x-raw-yuv,format=(fourcc)NV12,width=1920,height=1080' ! dmaiaccel ! dmaiperf ! TIDmaiVideoSink \
           videoStd=1080P_25 videoOutput=DVI

fps measured is 37 and Armload is 5

Pipeline 2b - 1080p hdmi output playing on the TV Monitor

gst-launch -v v4l2src input-src=component chain-ipipe=true always-copy=false ! 'video/x-raw-yuv,format=(fourcc)NV12,width=1920,height=1080' \  
! dmaiaccel ! dmaiperf print-arm-load=true ! TIDmaiVideoSink enable-last-buffer=false videoStd=1080P_25 

fps measured is 41 and Armload is 9

Pipeline 3 - 1080P HDMI Output recording.

H264ENC_PARMS="encodingpreset=2 ratecontrol=2 intraframeinterval=23 idrinterval=46 targetbitrate=1000000 profile=100 level=50 entropy=1 t8x8inter=true t8x8intra=true single-nalu=true"

gst-launch v4l2src always-copy=FALSE input-src=component chain-ipipe=true num-buffers=2000 ! 'video/x-raw-yuv,format=(fourcc)NV12,width=1920,height=1088' ! dmaiaccel ! dmaienc_h264 $H264ENC_PARMS ! queue ! dmaiperf print-arm-load=true !
 qtmux ! queue ! filesink location=test2.mp4 sync=false enable-last-buffer=false

fps measured is 29 and Armload is 10

Pipeline 4 - Live preview 1080p HDMI Output recording and playing on the tv monitor.

H264ENC_PARMS="encodingpreset=2 ratecontrol=2 intraframeinterval=23 idrinterval=46 targetbitrate=1000000 \
profile=100 level=50 entropy=1 t8x8inter=true t8x8intra=true single-nalu=true"

gst-launch v4l2src input-src=component chain-ipipe=true always-copy=false num-buffers=2000 ! 'video/x-raw-yuv,format=(fourcc)NV12,\
width=1920,height=1088' ! dmaiaccel ! tee name=t1 ! queue ! TIDmaiVideoSink enable-last-buffer=false videoStd=1080P_25 videoOutput=DVI sync=false t1. ! \
queue ! dmaienc_h264 $H264ENC_PARMS ! queue ! dmaiperf print-arm-load=true ! qtmux ! queue ! filesink location=test.mp4 sync=false enable-last-buffer=false

fps measured is 18 to 18.9 and ARM load is 21

SDK Configurations for 720p output through LI-DVI1

Architecture configurations --->
Video Output ---> PRGB
Maximum Video Output Buffer Size (720P) --->
Maximum Video Input Buffer Size (720P) --->
Proprietary Software ---->
Amount of reserved memory from the Kernel -> 0x3200000
Amount of reserved memory for cmemk -> 0x1E00000
Kernel configuration -> Extra kernel arguments
dm365_generic_prgb_encoder.mode=1280x720MR-16@60

SDK Configurations for 1080p output through LI-DVI1

Architecture configurations --->
Video Output ---> PRGB
Maximum Video Output Buffer Size (1080I) --->
Maximum Video Input Buffer Size (1080P) --->
Proprietary Software ---->
Amount of reserved memory from the Kernel -> 0x3800000
Amount of reserved memory for cmemk -> 0x1E00000
Kernel configuration -> Extra kernel arguments
dm365_generic_prgb_encoder.mode=1920x1080MR-16@60