DM36x TVP7002 GStreamer Passthrough Pipeline

From RidgeRun Developer Connection
Jump to: navigation, search

Overview

Component Video is fed to DM36x leopardboard through the TVP7002 hardware interfac. Encode and record video in H264 video format (720p Resolution) to a file in a SD card while also passing video frames through the video output to be displayed on an HD Monitor (HD 1080p TV).

GStreamer Pipeline with DM36x leopardboard with TVP7002 hardware interface:

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

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

This functionality can be tested with L1-5M03 (MT9P031) Camera sensor board.1

GStreamer Pipeline with DM36x leoboard with L1-5M03 MT9P031 hardware interface

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

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

Test Results:

FPS ARM Clock ARM Load
30 29% 446 MHz


Test Procedure to Verify the Passthru pipeline into halves

To verify the performance of the passthru pipeline, we can test it seperately (into halves) the video output and video encoding/recording part of the passthru pipeline.


Test Procedure:

Main Passthru pipeline:

Note: Tested using DM368 Leoboard + L15M03 (mt9p031) camera sensor


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

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


Pipeline 1 (Video Output part) :

gst-launch -v --gst-debug-level=2 v4l2src input-src=camera chain-ipipe=true always-copy=false ! 'video/x-raw-yuv,format=(fourcc)NV12,width=1280,height=720' \
                    ! dmaiaccel ! dmaiperf print-arm-load=true ! TIDmaiVideoSink enable-last-buffer=false videoStd=720P_60 


Test Results:

FPS
ARM Load
ARM Clock
30
7%
446MHz


Pipeline 2: (video encoding/recording part):

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

gst-launch -v --gst-debug-level=2 v4l2src always-copy=FALSE input-src=camera chain-ipipe=true num-buffers=3000 ! '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 
FPS
ARM Load
ARM Clock
30
15%
446MHz

Passthru pipeline with Audio and Video encoding/recording

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

gst-launch -e alsasrc latency-time=30000 buffer-time=800000 ! 'audio/x-raw-int, endianness=(int)1234, signed=(boolean)true,width=(int)16, depth=(int)16, \
      rate=(int)8000,channels=(int)1' ! dmaienc_aac bitrate=8000 outputBufferSize=131072 ! queue ! qtmux name=m v4l2src input-src=component \
              chain-ipipe=true always-copy=false num-buffers=3000 ! 'video/x-raw-yuv,format=(fourcc)NV12,width=1280,height=720,\ 
                    framerate=(fraction)30/1' ! dmaiaccel ! tee name=t1 ! queue ! TIDmaiVideoSink enable-last-buffer=false \ 
                       videoStd=720P_60 videoOutput=COMPONENT sync=false t1. ! queue ! dmaienc_h264 $H264ENC_PARMS ! queue ! \ 
                            dmaiperf print-arm-load=true ! m. m. ! queue ! filesink location=test.mp4 
                                                   enable-last-buffer=false 


Log output while above pipeline (Audio and Video encoding/recording and Passthru) is running :

/ #gst-launch -e alsasrc latency-time=30000 buffer-time=800000 ! 'audio/x-raw-int, endianness=(int)1234, signed=(boolean)true,width=(int)16, depth=(int)16, \ 
rate=(int)8000,channels=(int)1' ! dmaienc_aac bitrate=8000 outputBufferSize=131072 ! queue ! qtmux name=m v4l2src input-src=component chain-ipipe=true \ 
always-copy=false num-buffers=3000 ! 'video/x-raw-yuv,format=(fourcc)NV12,width=1280,height=720, framerate=(fraction)30/1' ! dmaiaccel ! tee name=t1 ! \
queue ! TIDmaiVideoSink enable-last-buffer=false videoStd=720P_60 videoOutput=COMPONENT sync=false t1. ! queue ! dmaienc_h264 $H264ENC_PARMS ! \
queue ! dmaiperf print-arm-load=true ! m. m. ! queue ! filesink location=test.mp4 enable-last-buffer=false

Setting pipeline to PAUSED ...
davinci_resizer davinci_resizer.2: RSZ_G_CONFIG:0:1:124
vpfe-capture vpfe-capture: IPIPE Chained
vpfe-capture vpfe-capture: Resizer present
i2c_davinci i2c_davinci.1: initiating i2c bus recovery
Pipeline is live and does not need PREROLL ...
WARNING: from element /GstPipeline:pipeline0/GstDmaiperf:dmaiperf0: Could not get/set settings from/on resource.
Additional debug info:
../../src/src/gsttidmaiperf.c(273): gst_dmaiperf_start (): /GstPipeline:pipeline0/GstDmaiperf:dmaiperf0:
Engine name not specified, not printing DSP information
WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Video input device did not accept new frame rate setting.
Additional debug info:
../../../src/sys/v4l2/v4l2src_calls.c(342): gst_v4l2src_set_capture (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
system error: Invalid argument
Setting pipeline to PLAYING ...
New clock: GstAudioSrcClock
davinci_v4l2 davinci_v4l2.1: Before finishing with S_FMT:
layer.pix_fmt.bytesperline = 1280,
layer.pix_fmt.width = 1280,
layer.pix_fmt.height = 720,
layer.pix_fmt.sizeimage =1382400
davinci_v4l2 davinci_v4l2.1: pixfmt->width = 1280,
layer->layer_info.config.line_length= 1280
INFO:
Timestamp: 0:34:50.103156355; bps: 0; fps: 0.00; CPU: 0;
INFO:
Timestamp: 0:34:51.186923480; bps: 567426; fps: 26.77; CPU: 22;
INFO:
Timestamp: 0:34:52.195669064; bps: 549312; fps: 35.71; CPU: 31;
INFO:
Timestamp: 0:34:53.236664646; bps: 529180; fps: 36.53; CPU: 28;
INFO:
Timestamp: 0:34:54.258121064; bps: 512897; fps: 33.30; CPU: 23;
INFO:
Timestamp: 0:34:55.281944981; bps: 562583; fps: 38.12; CPU: 22;
INFO:
Timestamp: 0:34:56.296561231; bps: 561266; fps: 36.48; CPU: 29;
INFO:
Timestamp: 0:34:57.316179605; bps: 538850; fps: 36.31; CPU: 31;
INFO:
Timestamp: 0:34:58.353474688; bps: 548251; fps: 36.64; CPU: 25;
INFO:
Timestamp: 0:34:59.506979895; bps: 531424; fps: 33.82; CPU: 32;
INFO:
Timestamp: 0:35:00.531852854; bps: 504150; fps: 35.15; CPU: 25;
INFO:
Timestamp: 0:35:01.554594855; bps: 545849; fps: 36.20; CPU: 19;
INFO:
Timestamp: 0:35:02.576545520; bps: 506024; fps: 34.28; CPU: 27;
INFO:
Timestamp: 0:35:03.601622231; bps: 578488; fps: 38.04; CPU: 28;
INFO:
Timestamp: 0:35:04.626892315; bps: 542909; fps: 34.14; CPU: 67;
INFO:
Timestamp: 0:35:05.650941732; bps: 475545; fps: 34.17; CPU: 100;
INFO:
Timestamp: 0:35:06.684130024; bps: 506904; fps: 31.94; CPU: 100;
INFO:
Timestamp: 0:35:07.826748856; bps: 473290; fps: 33.27; CPU: 100;
INFO:
Timestamp: 0:35:08.851843605; bps: 512370; fps: 32.19; CPU: 66;
INFO:
Timestamp: 0:35:09.876215936; bps: 536576; fps: 37.10; CPU: 24;
INFO:
Timestamp: 0:35:10.896685979; bps: 532641; fps: 36.27; CPU: 25;
INFO:
Timestamp: 0:35:11.918545644; bps: 629252; fps: 40.15; CPU: 28;
INFO:
Timestamp: 0:35:12.946897143; bps: 494123; fps: 35.01; CPU: 35;
INFO:
Timestamp: 0:35:13.970951936; bps: 565026; fps: 37.10; CPU: 47;
INFO:
Timestamp: 0:35:14.974341936; bps: 484897; fps: 33.89; CPU: 100;
INFO:
Timestamp: 0:35:16.017939895; bps: 501170; fps: 32.59; CPU: 100;
INFO:
Timestamp: 0:35:17.052320063; bps: 536078; fps: 34.81; CPU: 100;
INFO:
Timestamp: 0:35:18.066770230; bps: 476095; fps: 32.54; CPU: 100;
INFO:
Timestamp: 0:35:19.070908106; bps: 554257; fps: 35.85; CPU: 100;
INFO:
Timestamp: 0:35:20.104549856; bps: 459169; fps: 30.00; CPU: 100;
INFO:
Timestamp: 0:35:21.124288482; bps: 455921; fps: 32.38; CPU: 100;
INFO:
Timestamp: 0:35:22.164094899; bps: 502732; fps: 32.72; CPU: 100;
INFO:
Timestamp: 0:35:23.184133149; bps: 514395; fps: 34.31; CPU: 100;
INFO:
Timestamp: 0:35:24.210942857; bps: 491264; fps: 32.16; CPU: 100;
INFO:
Timestamp: 0:35:25.244276982; bps: 502910; fps: 33.88; CPU: 100;
INFO:
Timestamp: 0:35:26.386720229; bps: 470052; fps: 31.52; CPU: 100;
INFO:
Timestamp: 0:35:27.423589853; bps: 514640; fps: 31.85; CPU: 100;
INFO:
Timestamp: 0:35:28.444190478; bps: 459453; fps: 32.35; CPU: 100;
INFO:
Timestamp: 0:35:29.586737646; bps: 492869; fps: 33.27; CPU: 100;
INFO:
Timestamp: 0:35:30.610933772; bps: 510541; fps: 33.20; CPU: 100;
INFO:
Timestamp: 0:35:31.643773356; bps: 462450; fps: 31.97; CPU: 100;
INFO:
Timestamp: 0:35:32.657798481; bps: 506882; fps: 32.54; CPU: 98;
INFO:
Timestamp: 0:35:33.795749856; bps: 542927; fps: 36.93; CPU: 28;
INFO:
Timestamp: 0:35:34.834552438; bps: 536960; fps: 34.68; CPU: 19;
INFO:
Timestamp: 0:35:35.986810352; bps: 485747; fps: 33.85; CPU: 22;
INFO:
Timestamp: 0:35:37.010952603; bps: 543430; fps: 35.15; CPU: 32;
INFO:
Timestamp: 0:35:38.044261353; bps: 470020; fps: 33.88; CPU: 52;
INFO:
Timestamp: 0:35:39.057516979; bps: 477171; fps: 31.58; CPU: 100;
INFO:
Timestamp: 0:35:40.083958771; bps: 544674; fps: 32.16; CPU: 100;
INFO:
Timestamp: 0:35:41.106712938; bps: 453586; fps: 33.26; CPU: 100;
INFO:
Timestamp: 0:35:42.143647939; bps: 519763; fps: 32.81; CPU: 100;
INFO:
Timestamp: 0:35:43.164210022; bps: 499209; fps: 34.31; CPU: 100;
INFO:
Timestamp: 0:35:44.175332605; bps: 537420; fps: 34.61; CPU: 29;
INFO:
Timestamp: 0:35:45.196477231; bps: 535241; fps: 39.17; CPU: 24;
INFO:
Timestamp: 0:35:46.216167272; bps: 588924; fps: 38.27; CPU: 29;
INFO:
Timestamp: 0:35:47.256415815; bps: 549154; fps: 38.46; CPU: 19;
INFO:
Timestamp: 0:35:48.276177148; bps: 602309; fps: 37.29; CPU: 31;
^CCaught interrupt -- handling interrupt.
Interrupt: Stopping pipeline ...
EOS on shutdown enabled -- Forcing EOS on the pipeline
Waiting for EOS...
Got EOS from element "pipeline0".
EOS received - stopping pipeline...
Execution ended after 58935485875 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...