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.

OMTB frame and bit rate commands

I have bee experimenting with the dual_display_encode_decode.oms OMTB example. Amongst other things I have tried to modify the encoding bit rate and frame rate and have found that some commands are accepted, but have no effect while others cause the encoder to fail.

1. I tried to change the frame rate because querying it value returned:

   Frame rate....................................3932160

I used:

   omx setp 0 h264venc framerate 60

And when I do so, invoking 'omx getp 0 h264venc' does show the value 60 has been accepted

   Frame rate....................................60

However, when trying to run the example, I see no video and no encoded file.

 

2. I tried to change the encoding bit rate for a long time using the following commands

    omx setp 0 h264venc OMX_IndexParamVideoBitrate nTargetBitrate 5000000
    omx setp 0 h264venc OMX_IndexParamVideoBitrate eControlRate variable

The commands are accepted, and the output of omx getp 0 h264venc OMX_IndexParamVideoBitrate' reflects the change, but the encoding rate seems unaffected.

I was eventually able to affect the frame rate through:

    omx setp 0 h264venc framerate 30

but that is making ask from all the data contained in the output of 'omx getp 0 h264venc' which are actually meaningful? Is this documented somewhere?

H264 Video Encoder Config Parameters:

   OMX Component name............................OMX.TI.DUCATI.VIDENC
   Input File name...............................h264venc_sample.yuv
   Output File name............................../usr/share/ti/data/videos/dm816x_1080p60_encode_20M.264
   Input Frame Width.............................1920
   Input Frame Height............................1080
   I/P Chroma Format.............................420SP
   Data O/P Mode.................................file
   I/P Buffer allocation Mode....................use
   Number of i/p buffer..........................8
   I/p buffer alignment..........................0
   Contiguous i/p buffer memory..................enable
   I/P buffer size input from user...............disable
   I/p buffer size...............................4147200
   O/P Buffer allocation Mode....................use
   Number of o/p buffer..........................4
   O/p buffer alignment..........................0
   Contiguous o/p buffer memory..................enable
   O/P buffer size input from user...............enable
   O/p buffer size...............................3110400
   O/P Compression Format........................avc
   I/P Stride (# of bytes per span of image).....0
   Bitrate.......................................20000000
   Frame rate....................................3932160
   Max file size for OMTB demo...................536870912
   OMX_IndexConfigVideoFramerate Index Parameters:
      Frame rate....................................3932160
   OMX_IndexConfigVideoBitrate Index Parameters:
      Bitrate.......................................1000000
   OMX_TI_IndexConfigVideoMESearchRange Index Parameters:
      Motion vector accuracy........................quarterpel
      ME Horizontal Search Range for P Frames.......16
      ME Vertical Search Range for P Frames.........16
      ME Horizontal Search Range for B Frames.......16
      ME Vertical Search Range for B Frames.........16
   OMX_IndexConfigVideoIntraVOPRefresh Index Parameters:
      Intra Refresh VOP.............................disable
   OMX_TI_IndexConfigVideoQPSettings Index Parameters:
      QP for I frames...............................25
      QP Max for I frames...........................51
      QP Min for I frames...........................0
      QP for P frames...............................25
      QP Max for P frames...........................51
      QP Min for P frames...........................0
      QP offset for B frames........................4
      QP Max for B frames...........................51
      QP Min for B frames...........................0
   OMX_IndexConfigVideoAVCIntraPeriod Index Parameters:
      IDR period....................................128
      P frames period...............................0
   OMX_TI_IndexConfigSliceSettings Index Parameters:
      Slice Mode Type...............................default
      Slice Size....................................0
   OMX_TI_IndexConfigVideoPixelInfo Index Parameters:
      Input Pixel Width.............................0
      Input Pixel Height............................0
   OMX_TI_IndexParamVideoNALUsettings Index Parameters:
      NALU Start of Sequence........................0
      NALU End of Sequence..........................0
      NALU IDR Frame #..............................0
      NALU Intra Picture #..........................0
      NALU Non Intra Picture #......................0
   OMX_TI_IndexParamVideoAdvancedFMO Index Parameters:
      FMO Num Slice Groups..........................0
      FMO Slice Groups Map Type.....................0
      FMO Slice Groups Change Direction.............raster
      FMO Slice Groups Change Rate..................0
      FMO Slice Groups Change Cycle.................0
      FMO Slice Groups Param 0......................0
      FMO Slice Groups Param 1......................0
   OMX_TI_IndexParamVideoMEBlockSize Index Parameters:
      ME Min Block Size - P Frame...................16x16
      ME Min Block Size - B Frame...................16x16
   OMX_IndexParamVideoIntraRefresh Index Parameters:
      Intra Refresh Mode............................cyclic
      # of Intra MBs to be Refreshed................0
      # of times Motion marked MB be Intra Coded....0
      # of Consecutive MBs to be Intra Coded........0
   OMX_TI_IndexParamVideoVUIsettings Index Parameters:
      VUI Aspect Ratio Present Flag.................disable
      VUI Pixel Aspect Ratio........................none
      VUI Pixel Value Full Range Flag...............disable
   OMX_TI_IndexParamVideoIntraPredictionSettings Index Parameters:
      Luma Intra 4x4 Pred Modes Enabled.............0
      Luma Intra 8x8 Pred Modes Enabled.............0
      Luma Intra 16x16 Pred Modes Enabled...........0
      Chroma Intra 8x8 Pred Modes Enabled...........0
      Chroma Intra Component........................cr_only
   OMX_TI_IndexParamVideoDataSyncMode Index Parameters:
      Video Data Mode...............................fixed_length
      Video Num Data Units..........................0
   OMX_IndexConfigVideoNalSize Index Parameters:
      NAL bytes .....................................0
   OMX_IndexParamVideoAvc Index Parameters:
      Num MBs Between Slice Header..................0
      Max # of P Frames between each I Frames.......1
      Max # of B Frames between each I Frames.......0
      Hadamard Transform............................disable
      # of Refrence Frames..........................0
      Refrence Index in Bwd Frames list.............0
      Refrence Index in Fwd Frames list.............0
      Unequal Error Protection......................disable
      Flexible Macroblock Ordering..................disable
      Arbitrary Slice Ordering......................disable
      Redundant Slices..............................disable
      AVC Profile...................................high
      AVC Level.....................................4.1
      Picture Types Allowed In Bitstream............0
      Frame MBs Only................................disable
      Frame Field MB Switching......................disable
      CABAC.........................................disable
      Weighted Prediction for P frames..............disable
      Weighted Biprediciton Mode....................0
      Constrained Intra Prediction..................disable
      Luma Motion Vector Method for B Frames........disable
      Spatial/Temporal mode for B Frame Coding......disable
      CABAC Context Init Index......................0
      Loop Filter Mode..............................enable
   OMX_IndexParamVideoBitrate Index Parameters:
      Param Bitrate.................................0
      Param Rate Control Algorithm..................disable
   OMX_IndexParamVideoProfileLevelCurrent Index Parameters:
      Profile.......................................high
      Level.........................................4.1
   OMX_TI_IndexParamVideoBitStreamFormatSelect Index Parameters:
      Bitstream Format..............................byte
   OMX_TI_IndexParamVideoEncoderPreset Index Parameters:
      Encoder Preset................................userdef
      Rate Control Preset...........................msmq
   OMX_TI_IndexParamVideoFrameDataContentSettings Index Parameters:
      Input Content Type............................progressive
      Interlace Coding Type.........................picaff
   OMX_TI_IndexParamVideoTransformBlockSize Index Parameters:
      Transform Block Size..........................8x8
   OMX_IndexParamVideoSliceFMO Index Parameters:
      Num Slice Group...............................0
      Slice Group map type..........................0
      Slice Mode Type...............................default
   OMX_IndexParamVideoMotionVector Index Parameters:
      Unrestricted Motion Vector....................disable
      Four Motion Vectors...........................disable
      Motion Vector X Search Range .................16
      Motion Vector Y Search Range .................16
   OMX_TI_IndexParamBuffMemType Index Parameters:
      Buffer Memory Type............................default
   OMX_IndexParamCompBufferSupplier Index Parameters:
      Buffer Supplier Type..........................unspecified
   OMX_IndexParamVideoInit Index Parameters:
      Number of i/p + o/p Ports ....................2
      Start Port Number ............................0
   OMX_IndexParamVideoPortFormat Index Parameters:
      Compression Format............................avc
      Color Format..................................420SP
      Frame rate....................................3932160
   OMX_IndexParamVideoQuantization Index Parameters:
      QP for I frames...............................25
      QP for P frames...............................25
      QP for B frames...............................4
   OMX_TI_IndexParamCompPortNotifyType Index Parameters:
      Comp Port Notify Type.........................always
   OMX_IndexParamPortDefinition Index Parameters:
      Port Direction................................input
      Buffer Count Actual...........................4
      Buffer Count Min..............................1
      Buffer Size...................................3110400
      Port Default Status...........................disable
      Port Populated................................disable
      Domain........................................video
      Buffers Contiguous............................disable
      Buffer Alignment..............................0
      MIME Type.....................................
      Native Render.................................0
      Frame Width...................................720
      Frame Height..................................480
      Stride........................................720
      Slice Height..................................0
      Bit Rate......................................0
      Frame Rate....................................0
      Flag Error Concealment........................disable
      Compression Format............................unused
      Color Format..................................420SP
      Native Window.................................0
   OMX_TI_IndexConfigChannelName Index Parameters:
      Frame Queue Channel name......................NULL

  • Hi Bernard,

    Frame Rate for h264venc has to be set in Q16 format which is “2 pow 16 * framerate”

    Please find the attached omtb script which includes  framerate set as “2 pow 16 * 60” and bitrate set as 5Mbps.

    #omx omtb_dbg_lvl 0x00
    #omx omtb_dbg_lvl 0x04
    #omx omtb_dbg_lvl 0x08
    #omx omtb_dbg_lvl 0x10
    #omx omtb_dbg_lvl 0x80
    omx api init
    omx setp 0 vfcc compname OMX.TI.VPSSM3.VFCC 
    omx setp 0 tvp compname OMX.TI.VPSSM3.CTRL.TVP
    omx setp 0 h264vdec frame_width 1920
    omx setp 0 h264vdec frame_height 1080
    omx setp 0 h264vdec inbuf allocate
    omx setp 0 h264vdec outbuf allocate
    omx setp 0 h264vdec inbufsize_flag enable
    omx setp 0 h264vdec outbufsize_flag enable
    omx setp 0 h264vdec inbufsize 2088960
    omx setp 0 h264vdec outbufsize 3612672
    omx setp 0 h264vdec infile /usr/share/ti/data/videos/dm816x_1080p_demo.264
    omx setp 0 h264vdec numinbuf  10
    omx setp 0 h264vdec numoutbuf 6
    omx setp 0 h264vdec framerate 60
    omx setp 0 h264vdec data_opmode driver
    omx setp 0 sc frame_width 1920
    omx setp 0 sc frame_height 1080
    omx setp 0 sc op_chromat_format 422YUYV
    omx setp 0 sc ip_chromat_format 420SP
    omx setp 0 sc numinbuf 6
    omx setp 0 sc inbufalign 0
    omx setp 0 sc inbuf_contig disable
    omx setp 0 sc inbufsize_flag enable
    omx setp 0 sc inbufsize 3612672
    omx setp 0 sc numoutbuf 8
    omx setp 0 sc outbufalign 0
    omx setp 0 sc outbuf_contig disable
    omx setp 0 sc outbufsize_flag enable
    omx setp 0 sc outbufsize 4147200 
    omx setp 0 sc data_opmode driver
    omx setp 0 sc inbuf use
    omx setp 0 vfdc frame_width 1920
    omx setp 0 vfdc frame_height 1080
    omx setp 0 vfdc ip_chromat_format 422YUYV
    omx setp 0 vfdc numinbuf 8 
    omx setp 0 vfdc inbufalign 0
    omx setp 0 vfdc inbuf_contig disable
    omx setp 0 vfdc inbufsize 4147200 
    omx setp 0 vfdc inbuf use
    omx setp 0 vfdc graphics_flag disable
    #omx setp 0 vfdc vcdemo_flag enable
    omx setp 0 vfdc mosaic_window_config vs
    omx setp 0 dc insmod_hdmi disable
    omx api gethandle h264vdec 0 0
    omx api gethandle sc 0 0
    omx api gethandle vfdc 0 0
    omx api gethandle dc 0 0
    omx setp 0 vfdc OMX_TI_IndexParamVFDCDriverInstId nDrvInstID 1
    omx setp 0 vfdc OMX_TI_IndexParamVFDCDriverInstId eDispVencMode 1080p60
    omx api setparam  vfdc 0 0 0 OMX_TI_IndexParamVFDCDriverInstId
    omx setp 0 vfdc OMX_TI_IndexParamVFDCCreateMosaicLayout winStartX 0
    omx setp 0 vfdc OMX_TI_IndexParamVFDCCreateMosaicLayout winStartY 0
    omx setp 0 vfdc OMX_TI_IndexParamVFDCCreateMosaicLayout winWidth 1920
    omx setp 0 vfdc OMX_TI_IndexParamVFDCCreateMosaicLayout winHeight 1080
    omx setp 0 vfdc OMX_TI_IndexParamVFDCCreateMosaicLayout pitch.VFDC_YUV_INT_ADDR_IDX 3840
    omx setp 0 vfdc OMX_TI_IndexParamVFDCCreateMosaicLayout pitch.VFDC_YUV_SP_Y_ADDR_IDX 3840
    omx setp 0 vfdc OMX_TI_IndexParamVFDCCreateMosaicLayout pitch.VFDC_YUV_SP_CBCR_ADDR_IDX 3840
    omx setp 0 vfdc OMX_TI_IndexParamVFDCCreateMosaicLayout dataFormat 422I_YUYV
    omx setp 0 vfdc OMX_TI_IndexParamVFDCCreateMosaicLayout bpp bits16
    omx setp 0 vfdc OMX_TI_IndexParamVFDCCreateMosaicLayout priority 0
    omx setp 0 vfdc OMX_TI_IndexParamVFDCCreateMosaicLayout nLayoutId 0
    omx setp 0 vfdc mosaicNumRows 1
    omx setp 0 vfdc mosaicNumCols 1
    omx setp 0 vfdc mosaicDispWindowWidth 1920
    omx setp 0 vfdc mosaicDispWindowHeight 1080
    omx api setparam  vfdc 0 0 0 OMX_TI_IndexParamVFDCCreateMosaicLayout
    omx setp 0 vfdc OMX_TI_IndexConfigVFDCMosaicPort2WinMap nLayoutId 0
    omx api setconfig vfdc 0 0 0 OMX_TI_IndexConfigVFDCMosaicPort2WinMap 1 0 
    omx setp 0 vfdc OMX_TI_IndexParamBuffMemType eBufMemoryType default
    omx setp 0 vfdc OMX_IndexParamCompBufferSupplier eBufferSupplier unspecified
    omx setp 0 vfdc OMX_IndexParamVideoInit nPorts 1
    omx setp 0 vfdc OMX_IndexParamVideoInit nStartPortNumber 0
    omx api getparam  vfdc 0 0 0 OMX_IndexParamPortDefinition
    omx setp 0 vfdc OMX_IndexParamPortDefinition video.nStride 3840
    omx api setparam  vfdc 0 0 0 OMX_IndexParamPortDefinition
    #************************************************************
    #SET ALL THE PARAMS FOR DC#0
    omx setp 0 dc OMX_TI_IndexParamVFDCDriverInstId nDrvInstID 1
    omx setp 0 dc OMX_TI_IndexParamVFDCDriverInstId eDispVencMode 1080p60
    omx api setparam  dc 0 0 0 OMX_TI_IndexParamVFDCDriverInstId
    omx api getparam  sc 0 0 0 OMX_IndexParamPortDefinition
    omx setp 0 sc OMX_IndexParamPortDefinition video.nStride 2048
    omx setp 0 sc OMX_IndexParamPortDefinition video.nFrameHeight 1080
    omx setp 0 sc OMX_IndexParamPortDefinition video.nFrameWidth 1920
    omx api setparam  sc 0 0 0 OMX_IndexParamPortDefinition
    omx setp 0 sc OMX_TI_IndexParamVFPCNumChPerHandle nNumChannelsPerHandle 1
    omx api setparam  sc 0 0 0 OMX_TI_IndexParamVFPCNumChPerHandle
    omx setp 0 sc OMX_TI_IndexConfigVidChResolution Frm0Width  1920
    omx setp 0 sc OMX_TI_IndexConfigVidChResolution Frm0Height 1080
    omx setp 0 sc OMX_TI_IndexConfigVidChResolution Frm0Pitch  2048
    omx setp 0 sc OMX_TI_IndexConfigVidChResolution Frm1Width  0
    omx setp 0 sc OMX_TI_IndexConfigVidChResolution Frm1Height 0
    omx setp 0 sc OMX_TI_IndexConfigVidChResolution Frm1Pitch  0
    omx setp 0 sc OMX_TI_IndexConfigVidChResolution FrmStartX  0
    omx setp 0 sc OMX_TI_IndexConfigVidChResolution FrmStartY  0
    omx setp 0 sc OMX_TI_IndexConfigVidChResolution FrmCropWidth 0
    omx setp 0 sc OMX_TI_IndexConfigVidChResolution FrmCropHeight 0 
    omx setp 0 sc OMX_TI_IndexConfigVidChResolution eDir input
    omx setp 0 sc OMX_TI_IndexConfigVidChResolution nChId 0
    omx api setconfig  sc 0 0 0 OMX_TI_IndexConfigVidChResolution
    omx setp 0 sc OMX_TI_IndexConfigVidChResolution Frm0Width  1920
    omx setp 0 sc OMX_TI_IndexConfigVidChResolution Frm0Height 1080
    omx setp 0 sc OMX_TI_IndexConfigVidChResolution Frm0Pitch  3840
    omx setp 0 sc OMX_TI_IndexConfigVidChResolution Frm1Width  0
    omx setp 0 sc OMX_TI_IndexConfigVidChResolution Frm1Height 0
    omx setp 0 sc OMX_TI_IndexConfigVidChResolution Frm1Pitch  0
    omx setp 0 sc OMX_TI_IndexConfigVidChResolution FrmStartX  0
    omx setp 0 sc OMX_TI_IndexConfigVidChResolution FrmStartY  0
    omx setp 0 sc OMX_TI_IndexConfigVidChResolution FrmCropWidth 0
    omx setp 0 sc OMX_TI_IndexConfigVidChResolution FrmCropHeight 0
    omx setp 0 sc OMX_TI_IndexConfigVidChResolution eDir output
    omx setp 0 sc OMX_TI_IndexConfigVidChResolution nChId 0
    omx api setconfig  sc 0 0 16 OMX_TI_IndexConfigVidChResolution
    omx setp 0 sc OMX_TI_IndexParamBuffMemType eBufMemoryType default
    omx api setparam  sc 0 0 0 OMX_TI_IndexParamBuffMemType
    omx setp 0 sc OMX_TI_IndexParamBuffMemType eBufMemoryType default
    omx api setparam  sc 0 0 16 OMX_TI_IndexParamBuffMemType
    omx setp 0 sc OMX_TI_IndexConfigAlgEnable bAlgBypass disable
    omx setp 0 sc OMX_TI_IndexConfigAlgEnable nChId 0
    omx api setconfig sc 0 0 0 OMX_TI_IndexConfigAlgEnable
    omx api sendcommand port sc 0 enable 0
    omx api sendcommand port sc 0 waitforsem 0
    omx api sendcommand port sc 0 enable 16
    omx api sendcommand port sc 0 waitforsem 16
    omx api sendcommand port h264vdec 0 enable 0
    omx api sendcommand port h264vdec 0 waitforsem 0
    omx api sendcommand port vfdc 0 enable 0
    omx api sendcommand port vfdc 0 waitforsem 0
    omx api sendcommand port h264vdec 0 enable 1
    omx api sendcommand port h264vdec 0 waitforsem 1
    omx api connect h264vdec 0 1 sc 0 0
    omx api connect sc 0 16 vfdc 0 0
    #************************************************************
    #I/P Port or O/P Port Params for VFCC
    omx setp 0 vfcc numoutbuf 6
    omx setp 0 vfcc frame_width 1920
    omx setp 0 vfcc frame_height 1080
    omx setp 0 vfcc op_chromat_format 420SP
    omx setp 0 vfcc outbufalign 0
    omx setp 0 vfcc outbuf_contig disable
    omx setp 0 vfcc outbufsize 3110400
    omx setp 0 vfcc data_opmode driver
    omx setp 0 vfcc outbuf allocate
    omx setp 0 vfcc outbufsize_flag disable
    omx setp 0 vfcc numoutbuf 6
    omx setp 0 vfcc outbuf_contig disable
    omx setp 0 dei frame_width 1920
    omx setp 0 dei frame_height 1080
    omx setp 0 dei op_chromat_format 420SP
    omx setp 0 dei ip_chromat_format 420SP
    omx setp 0 dei numinbuf 6 
    omx setp 0 dei inbufalign 0 
    omx setp 0 dei inbuf_contig disable
    omx setp 0 dei inbufsize_flag disable
    omx setp 0 dei inbufsize 3110400
    omx setp 0 dei numoutbuf 8
    omx setp 0 dei outbufalign 0
    omx setp 0 dei outbuf_contig disable
    omx setp 0 dei outbufsize_flag enable
    omx setp 0 dei outbufsize 4147200 
    omx setp 0 dei data_opmode driver
    omx setp 0 dei inbuf use
    omx setp 0 dei outbuf allocate
    omx setp 0 h264venc numinbuf 8
    omx setp 0 h264venc frame_width 1920
    omx setp 0 h264venc frame_height 1080
    omx setp 0 h264venc inbufsize 4147200
    omx setp 0 h264venc numoutbuf 4
    omx setp 0 h264venc outbufsize_flag enable
    omx setp 0 h264venc outbufsize 3110400
    omx setp 0 h264venc data_opmode driver
    #To enable write to SD card change mode to file
    omx setp 0 h264venc data_opmode file
    omx setp 0 h264venc outfile /usr/share/ti/data/videos/dm816x_1080p60_encode.264
    #Q-16 format 2^16 * framerate
    omx setp 0 h264venc framerate 3932160
    omx setp 0 vfdc frame_width 1920
    omx setp 0 vfdc frame_height 1080
    omx setp 0 vfdc ip_chromat_format 422YUYV
    omx setp 0 vfdc numinbuf 8 
    omx setp 0 vfdc inbufalign 0
    omx setp 0 vfdc inbuf_contig disable
    omx setp 0 vfdc inbufsize 4147200 
    omx setp 0 vfdc inbuf use
    omx setp 0 vfdc graphics_flag disable
    #omx setp 0 vfdc vcdemo_flag enable
    omx setp 0 vfdc mosaic_window_config vs
    omx setp 0 dc insmod_hdmi disable
    omx api gethandle tvp 0 0
    omx api gethandle vfcc 0 0
    omx api gethandle dei 0 0
    omx api gethandle h264venc 0 0
    omx api gethandle vfdc 1 0
    omx api gethandle dc 1 0
    #SET ALL THE PARAMS FOR TVP
    omx setp 0 tvp OMX_TI_IndexParamVFCCHwPortID eHwPortId vip1_porta
    omx api setparam tvp 0 0 0 OMX_TI_IndexParamVFCCHwPortID
    omx setp 0 tvp OMX_TI_IndexParamVFCCHwPortProperties eCaptMode sc_non_mux
    omx setp 0 tvp OMX_TI_IndexParamVFCCHwPortProperties eVifMode 16_bit
    omx setp 0 tvp OMX_TI_IndexParamVFCCHwPortProperties eInColorFormat 422YUYV
    omx setp 0 tvp OMX_TI_IndexParamVFCCHwPortProperties eScanType progressive
    omx setp 0 tvp OMX_TI_IndexParamVFCCHwPortProperties nMaxWidth 1920
    omx setp 0 tvp OMX_TI_IndexParamVFCCHwPortProperties nMaxHeight 1080
    omx setp 0 tvp OMX_TI_IndexParamVFCCHwPortProperties nMaxChnlsPerHwPort 1
    omx api setparam tvp 0 0 0 OMX_TI_IndexParamVFCCHwPortProperties
    omx setp 0 tvp OMX_TI_IndexParamCTRLVidDecInfo videoStandard 1080P60
    omx setp 0 tvp OMX_TI_IndexParamCTRLVidDecInfo videoDecoderId tvp7002
    omx setp 0 tvp OMX_TI_IndexParamCTRLVidDecInfo videoSystemId auto_detect
    omx api setparam tvp 0 0 0 OMX_TI_IndexParamCTRLVidDecInfo
    #************************************************************
    #SET ALL THE PARAMS FOR VFCC
    omx setp 0 vfcc OMX_TI_IndexParamVFCCHwPortID eHwPortId vip1_porta
    omx api setparam vfcc 0 0 0 OMX_TI_IndexParamVFCCHwPortID
    omx setp 0 vfcc OMX_TI_IndexParamVFCCHwPortProperties eCaptMode sc_non_mux
    omx setp 0 vfcc OMX_TI_IndexParamVFCCHwPortProperties eVifMode 16_bit
    omx setp 0 vfcc OMX_TI_IndexParamVFCCHwPortProperties eInColorFormat 422YUYV
    omx setp 0 vfcc OMX_TI_IndexParamVFCCHwPortProperties eScanType progressive
    omx setp 0 vfcc OMX_TI_IndexParamVFCCHwPortProperties nMaxWidth 1920
    omx setp 0 vfcc OMX_TI_IndexParamVFCCHwPortProperties nMaxHeight 1080
    omx setp 0 vfcc OMX_TI_IndexParamVFCCHwPortProperties nMaxChnlsPerHwPort 1
    omx api setparam vfcc 0 0 0 OMX_TI_IndexParamVFCCHwPortProperties
    omx setp 0 vfcc OMX_TI_IndexParamBuffMemType eBufMemoryType default
    omx api setparam  vfcc 0 0 0  OMX_TI_IndexParamBuffMemType
    omx setp 0 vfcc OMX_IndexParamCompBufferSupplier eBufferSupplier unspecified
    #omx api setparam  vfcc 0 0 0  OMX_IndexParamCompBufferSupplier
    omx setp 0 vfcc OMX_TI_IndexConfigVFCCFrameSkip frameSkipMask 0
    #omx api setconfig  vfcc 0 0 0  OMX_TI_IndexConfigVFCCFrameSkip
    omx setp 0 vfcc OMX_IndexParamVideoInit nPorts 16
    omx setp 0 vfcc OMX_IndexParamVideoInit nStartPortNumber 0
    #omx api setparam  vfcc 0 0 0  OMX_IndexParamVideoInit
    omx setp 0 dei OMX_TI_IndexParamVFPCNumChPerHandle nNumChannelsPerHandle 1
    omx api setparam dei 0 0 0 OMX_TI_IndexParamVFPCNumChPerHandle
    omx setp 0 dei OMX_TI_IndexConfigAlgEnable bAlgBypass enable
    omx setp 0 dei OMX_TI_IndexConfigAlgEnable nChId 0
    omx api setconfig dei 0 0 0 OMX_TI_IndexConfigAlgEnable
    omx setp 0 dei OMX_TI_IndexConfigSubSamplingFactor nSubSamplingFactor 1
    omx api setconfig dei 0 0 0 OMX_TI_IndexConfigSubSamplingFactor
    omx setp 0 dei OMX_TI_IndexConfigVidChResolution Frm0Width  1920
    omx setp 0 dei OMX_TI_IndexConfigVidChResolution Frm0Height 1080
    omx setp 0 dei OMX_TI_IndexConfigVidChResolution Frm0Pitch  1920
    omx setp 0 dei OMX_TI_IndexConfigVidChResolution Frm1Width  0
    omx setp 0 dei OMX_TI_IndexConfigVidChResolution Frm1Height 0
    omx setp 0 dei OMX_TI_IndexConfigVidChResolution Frm1Pitch  0
    omx setp 0 dei OMX_TI_IndexConfigVidChResolution FrmStartX  0
    omx setp 0 dei OMX_TI_IndexConfigVidChResolution FrmStartY  0
    omx setp 0 dei OMX_TI_IndexConfigVidChResolution FrmCropWidth 1920
    omx setp 0 dei OMX_TI_IndexConfigVidChResolution FrmCropHeight 1080
    omx setp 0 dei OMX_TI_IndexConfigVidChResolution eDir input
    omx setp 0 dei OMX_TI_IndexConfigVidChResolution nChId 0
    omx api setconfig dei 0 0 0  OMX_TI_IndexConfigVidChResolution
    omx setp 0 dei OMX_TI_IndexConfigVidChResolution Frm0Width  1920
    omx setp 0 dei OMX_TI_IndexConfigVidChResolution Frm0Height 1080
    omx setp 0 dei OMX_TI_IndexConfigVidChResolution Frm0Pitch  3840
    omx setp 0 dei OMX_TI_IndexConfigVidChResolution Frm1Width  1920
    omx setp 0 dei OMX_TI_IndexConfigVidChResolution Frm1Height 1080
    omx setp 0 dei OMX_TI_IndexConfigVidChResolution Frm1Pitch  1920
    omx setp 0 dei OMX_TI_IndexConfigVidChResolution FrmStartX  0
    omx setp 0 dei OMX_TI_IndexConfigVidChResolution FrmStartY  0
    omx setp 0 dei OMX_TI_IndexConfigVidChResolution FrmCropWidth 1920
    omx setp 0 dei OMX_TI_IndexConfigVidChResolution FrmCropHeight 1080
    omx setp 0 dei OMX_TI_IndexConfigVidChResolution eDir output
    omx setp 0 dei OMX_TI_IndexConfigVidChResolution nChId 0
    omx api setconfig dei 0 0 16  OMX_TI_IndexConfigVidChResolution
    omx setp 0 dei OMX_TI_IndexParamBuffMemType eBufMemoryType default
    omx api setparam  dei  0 0 0  OMX_TI_IndexParamBuffMemType
    omx setp 0 dei OMX_TI_IndexParamBuffMemType eBufMemoryType default
    omx api setparam  dei 0 0 16  OMX_TI_IndexParamBuffMemType
    omx setp 0 dei OMX_TI_IndexParamBuffMemType eBufMemoryType default
    omx api setparam  dei 0 0 17  OMX_TI_IndexParamBuffMemType
    omx setp 0 dei OMX_TI_IndexParamCompPortNotifyType eNotifyType always
    #omx api setparam  dei  0 0 0  OMX_TI_IndexParamCompPortNotifyType
    omx setp 0 dei OMX_TI_IndexParamCompPortNotifyType eNotifyType always
    #omx api setparam  dei  0 0 16  OMX_TI_IndexParamCompPortNotifyType
    omx setp 0 dei OMX_TI_IndexParamCompPortNotifyType eNotifyType always
    #omx api setparam dei 0 0 17   OMX_TI_IndexParamCompPortNotifyType
    omx setp 0 dei OMX_IndexParamCompBufferSupplier eBufferSupplier unspecified
    omx setp 0 dei  OMX_TI_IndexParamVFPCNumChPerHandle nNumChannelsPerHandle 1
    omx setp 0 dei OMX_IndexParamVideoInit nPorts 3
    omx setp 0 dei OMX_IndexParamVideoInit nStartPortNumber 0
    omx api getparam  dei 0 0 0 OMX_IndexParamPortDefinition
    omx setp 0 dei OMX_IndexParamPortDefinition video.nStride 1920
    omx api setparam  dei 0 0 0 OMX_IndexParamPortDefinition
    omx api getparam  h264venc 0 0 0 OMX_IndexParamPortDefinition
    omx setp 0 h264venc OMX_IndexParamPortDefinition video.nStride 1920
    omx api setparam  h264venc 0 0 0 OMX_IndexParamPortDefinition
    omx setp 0 h264venc OMX_IndexParamVideoBitrate nTargetBitrate 5000000
    omx setp 0 h264venc OMX_IndexParamVideoBitrate eControlRate variable
    omx api setparam  h264venc 0 0 1 OMX_IndexParamVideoBitrate
    omx setp 0 vfdc OMX_TI_IndexParamVFDCDriverInstId nDrvInstID 0
    omx setp 0 vfdc OMX_TI_IndexParamVFDCDriverInstId eDispVencMode 1080p60
    omx api setparam  vfdc 1 0 0 OMX_TI_IndexParamVFDCDriverInstId
    omx setp 0 vfdc OMX_TI_IndexParamVFDCCreateMosaicLayout winStartX 0
    omx setp 0 vfdc OMX_TI_IndexParamVFDCCreateMosaicLayout winStartY 0
    omx setp 0 vfdc OMX_TI_IndexParamVFDCCreateMosaicLayout winWidth 1920
    omx setp 0 vfdc OMX_TI_IndexParamVFDCCreateMosaicLayout winHeight 1080
    omx setp 0 vfdc OMX_TI_IndexParamVFDCCreateMosaicLayout pitch.VFDC_YUV_INT_ADDR_IDX 3840
    omx setp 0 vfdc OMX_TI_IndexParamVFDCCreateMosaicLayout pitch.VFDC_YUV_SP_Y_ADDR_IDX 3840
    omx setp 0 vfdc OMX_TI_IndexParamVFDCCreateMosaicLayout pitch.VFDC_YUV_SP_CBCR_ADDR_IDX 3840
    omx setp 0 vfdc OMX_TI_IndexParamVFDCCreateMosaicLayout dataFormat 422I_YUYV
    omx setp 0 vfdc OMX_TI_IndexParamVFDCCreateMosaicLayout bpp bits16
    omx setp 0 vfdc OMX_TI_IndexParamVFDCCreateMosaicLayout priority 0
    omx setp 0 vfdc OMX_TI_IndexParamVFDCCreateMosaicLayout nLayoutId 0
    omx setp 0 vfdc mosaicNumRows 1
    omx setp 0 vfdc mosaicNumCols 1
    omx setp 0 vfdc mosaicDispWindowWidth 1920
    omx setp 0 vfdc mosaicDispWindowHeight 1080
    omx api setparam  vfdc 1 0 0 OMX_TI_IndexParamVFDCCreateMosaicLayout
    omx setp 0 vfdc OMX_TI_IndexConfigVFDCMosaicPort2WinMap nLayoutId 0
    omx api setconfig vfdc 1 0 0 OMX_TI_IndexConfigVFDCMosaicPort2WinMap 1 0 
    omx setp 0 vfdc OMX_TI_IndexParamBuffMemType eBufMemoryType default
    omx setp 0 vfdc OMX_IndexParamCompBufferSupplier eBufferSupplier unspecified
    omx setp 0 vfdc OMX_IndexParamVideoInit nPorts 1
    omx setp 0 vfdc OMX_IndexParamVideoInit nStartPortNumber 0
    omx api getparam  vfdc 1 0 0 OMX_IndexParamPortDefinition
    omx setp 0 vfdc OMX_IndexParamPortDefinition video.nStride 3840
    omx api setparam  vfdc 1 0 0 OMX_IndexParamPortDefinition
    #************************************************************
    #SET ALL THE PARAMS FOR DC#0
    omx setp 0 dc OMX_TI_IndexParamVFDCDriverInstId nDrvInstID 0
    omx setp 0 dc OMX_TI_IndexParamVFDCDriverInstId eDispVencMode 1080p60
    omx api setparam  dc 1 0 0 OMX_TI_IndexParamVFDCDriverInstId
    omx api sendcommand port vfcc 0 enable 0
    omx api sendcommand port vfcc 0 waitforsem 0
    omx api sendcommand port dei 0 enable 0
    omx api sendcommand port dei 0 waitforsem 0
    omx api sendcommand port dei 0 enable 16
    omx api sendcommand port dei 0 waitforsem 16
    omx api sendcommand port dei 0 enable 17
    omx api sendcommand port dei 0 waitforsem 17
    omx api sendcommand port vfdc 1 enable 0
    omx api sendcommand port vfdc 1 waitforsem 0
    omx api sendcommand port h264venc 0 enable 0
    omx api sendcommand port h264venc 0 waitforsem 0
    omx api sendcommand port h264venc 0 enable 1
    omx api sendcommand port h264venc 0 waitforsem 1
    omx api connect vfcc 0 0 dei 0 0
    omx api connect dei 0 16 vfdc 1 0
    omx api connect dei 0 17 h264venc 0 0
    omx api sendcommand state h264vdec 0 idle
    omx api sendcommand state h264vdec 0 waitforsem
    omx api sendcommand state sc 0 idle
    omx api sendcommand state sc 0 waitforsem
    omx api sendcommand state vfcc 0 idle
    omx api sendcommand state vfcc 0 waitforsem
    omx api sendcommand state tvp 0 idle
    omx api sendcommand state tvp 0 waitforsem
    omx api sendcommand state dei 0 idle
    omx api sendcommand state dei 0 waitforsem
    omx api sendcommand state dc 1 idle
    omx api sendcommand state dc 1 waitforsem
    omx api sendcommand state vfdc 1 idle
    omx api sendcommand state vfdc 1 waitforsem
    omx api sendcommand state dc 0 idle
    omx api sendcommand state dc 0 waitforsem
    omx api sendcommand state vfdc 0 idle
    omx api sendcommand state vfdc 0 waitforsem
    omx api sendcommand state h264venc 0 idle
    omx api sendcommand state h264venc 0 waitforsem
    omx api sendcommand state h264vdec 0 exec
    omx api sendcommand state h264vdec 0 waitforsem
    omx api sendcommand state sc 0 exec
    omx api sendcommand state sc 0 waitforsem
    omx api sendcommand state dc 1 exec
    omx api sendcommand state dc 1 waitforsem
    omx api sendcommand state vfdc 1 exec
    omx api sendcommand state vfdc 1 waitforsem
    omx api sendcommand state dc 0 exec
    omx api sendcommand state dc 0 waitforsem
    omx api sendcommand state vfdc 0 exec
    omx api sendcommand state vfdc 0 waitforsem
    omx api sendcommand state vfcc 0 exec
    omx api sendcommand state vfcc 0 waitforsem
    omx api sendcommand state dei 0 exec
    omx api sendcommand state dei 0 waitforsem
    omx api sendcommand state h264venc 0 exec
    omx api sendcommand state h264venc 0 waitforsem
    omx api sendcommand state tvp 0 exec
    omx api sendcommand state tvp 0 waitforsem
    omx setp 0 aplay nSamplingRate 16000
    omx setp 0 aplay nNumSamples 480
    omx func alsa aplay 0 0
    sleep 1000
    omx setp 0 arecord nSamplingRate 16000
    omx setp 0 arecord nNumSamples 480
    omx func alsa arecord 0 0
    #omtbdemo t 60000 p test_pipe
    sleep 60000
    omx api sendcommand state h264vdec 0 idle
    omx api sendcommand state h264vdec 0 waitforsem
    omx api sendcommand state h264venc 0 idle
    omx api sendcommand state h264venc 0 waitforsem
    omx api sendcommand state sc 0 idle
    omx api sendcommand state sc 0 waitforsem
    omx api sendcommand state vfcc 0 idle
    omx api sendcommand state vfcc 0 waitforsem
    omx api sendcommand state tvp 0 idle
    omx api sendcommand state tvp 0 waitforsem
    omx api sendcommand state dei 0 idle
    omx api sendcommand state dei 0 waitforsem
    omx api sendcommand state dc 1 idle
    omx api sendcommand state dc 1 waitforsem
    omx api sendcommand state vfdc 1 idle
    omx api sendcommand state vfdc 1 waitforsem
    omx api sendcommand state dc 0 idle
    omx api sendcommand state dc 0 waitforsem
    omx api sendcommand state vfdc 0 idle
    omx api sendcommand state vfdc 0 waitforsem
    omx api sendcommand state h264vdec 0 loaded
    omx api sendcommand state h264vdec 0 waitforsem
    omx api sendcommand state h264venc 0 loaded
    omx api sendcommand state h264venc 0 waitforsem
    omx api sendcommand state sc 0 loaded
    omx api sendcommand state sc 0 waitforsem
    omx api sendcommand state vfcc 0 loaded
    omx api sendcommand state vfcc 0 waitforsem
    omx api sendcommand state tvp 0 loaded
    omx api sendcommand state tvp 0 waitforsem
    omx api sendcommand state dei 0 loaded
    omx api sendcommand state dei 0 waitforsem
    omx api sendcommand state dc 1 loaded
    omx api sendcommand state dc 1 waitforsem
    omx api sendcommand state vfdc 1 loaded
    omx api sendcommand state vfdc 1 waitforsem
    omx api sendcommand state dc 0 loaded
    omx api sendcommand state dc 0 waitforsem
    omx api sendcommand state vfdc 0 loaded
    omx api sendcommand state vfdc 0 waitforsem
    omx api freehandle h264vdec 0
    omx api freehandle sc 0
    omx api freehandle vfcc 0
    omx api freehandle tvp 0
    omx api freehandle dei 0
    omx api freehandle dc 0
    omx api freehandle dc 1
    omx api freehandle vfdc 0
    omx api freehandle vfdc 1
    omx api freehandle h264venc 0
    omx api uninit