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.

why hvenc blocks when it connect to vfcc?

Other Parts Discussed in Thread: TVP7002

I use the following oms file:

#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 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_ipmode 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

omx api gethandle tvp 0 0

omx api gethandle vfcc 0 0

omx api gethandle h264venc 0 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 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 api sendcommand port vfcc 0 enable 0

omx api sendcommand port vfcc 0 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 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 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 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 h264venc 0 exec

omx api sendcommand state h264venc 0 waitforsem

omx api sendcommand state tvp 0 exec

omx api sendcommand state tvp 0 waitforsem

sleep 60000

 

it will block in the following line:

OMTB> omx api sendcommand state h264venc 0 idle

OMTB-OMX_ErrorNone

OK

     

OMTB> omx api sendcommand state h264venc 0 waitforsem

 

why???

  • You'll need to filter the buffers from the vpcc to the dei before passing them to the encoder. 

  • hi,Marcus Cooksey:

          You can look this post:

         http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/131892.aspx

     

        it should be possible to construct a pipeline with

        OMX-VFCC, OMX-TVP_CTRL (420SP, TVP7002 component-in)->OMX-H.264 VENC.

     

        But I fail to construct a pipeline as such. why?

     

     

     

  • Hi Feng Xiao,

    Please find the attached modified omtb script which will solve the problem.

    The issue is with the configuration of "no of input buffers" of video encoder.

    VFCC -> H.264 Venc

    In the above usecase IL-Client (OMTB) "allocates the buffers on the output ports" of the VFCC component, these buffers are passed to the Input port of H.264 Venc component as "use buffer", so the no of allocated buffers should be same as no of use buffers.

    Thanks,

    Srinivas

     

    omx api init
    #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 h264venc numinbuf 6
    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_ipmode 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
    omx api gethandle tvp 0 0
    omx api gethandle vfcc 0 0
    omx api gethandle h264venc 0 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 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 api sendcommand port vfcc 0 enable 0
    omx api sendcommand port vfcc 0 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 h264venc 0 0
    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 h264venc 0 idle
    omx api sendcommand state h264venc 0 waitforsem
    omx api sendcommand state vfcc 0 exec
    omx api sendcommand state vfcc 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
    sleep 60000
    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 h264venc 0 idle
    omx api sendcommand state h264venc 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 h264venc 0 loaded
    omx api sendcommand state h264venc 0 waitforsem
    omx api freehandle tvp 0
    omx api freehandle vfcc 0
    omx api freehandle h264venc 0
    omx api uninit
    

     

  • thanks Srinivasa Reddy.

    very good answer!!!