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.

Cann't Configure TIVidenc1 Element bitRate (DM3730)

Other Parts Discussed in Thread: DM3730

Hi My dvsdk version is 4_02_00_06

set TIVidenc1 element properties bitRate=1500000 , pipeline work fine !

But use VLC to receive the MPEG-TS ,VLC report the bitRate > 1500000 bit/s ,some times the maxbitRate achieve to 3M bit/s

It seems TIVidenc1 bitRate Parameter is Invalid  ! Why ?

The following gst pipeline to test  .

gst-launch -e v4l2src always-copy=FALSE queue-size=4 ! 'video/x-raw-yuv,format= (fourcc)UYVY,width=720,height=576,framerate=(fraction)25/1' ! TIPrepEncBuf cont iguousInputFrame=TRUE numOutputBufs=4 ! queue max-size-buffers=4 max-size-byte s=0 ! TIVidenc1 codecName=h264enc engineName=codecServer bitRate=1500000 ! dma iperf ! mux. alsasrc ! audio/x-raw-int,rate=48000,channels=2 ! ffenc_mp2 bitrat e=64000 ! mux. mpegtsmux name=mux ! queue ! rtpmp2tpay ! udpsink port=8554 host =192.168.1.3

================================================================================================

Try set TIvidenc1 element properties rateControlPreset=2 (CBR),or encodingPreset =3 .

But gst pipeline can't work, TIVidenc1 has error! (failed to create video encoder: h264enc)

Use The following gst pipeline to test

=================================================================================================

gst-launch -e v4l2src always-copy=FALSE queue-size=4 ! 'video/x-raw-yuv,format= (fourcc)UYVY,width=720,height=576,framerate=(fraction)25/1' ! TIPrepEncBuf cont iguousInputFrame=TRUE numOutputBufs=4 ! queue max-size-buffers=4 max-size-byte s=0 ! TIVidenc1 bitRate=1500000 rateControlPreset=2 codecName=h264enc engineNa me=codecServer ! dmaiperf ! mux. alsasrc ! audio/x-raw-int,rate=48000,channels= 2 ! ffenc_mp2 bitrate=64000 ! mux. mpegtsmux name=mux ! queue ! rtpmp2tpay ! u dpsink port=8554 host=192.168.1.3

Setting pipeline to PAUSED ...

 

 

 

Pipeline is live and does not need PREROLL ...

WARNING: from element /GstPipeline:pipeline0/GstDmaiperf:dmaiperf0:

There is no codec present that can handle the stream's type. Additional debug info: gsttidmaiperf.c(285): gst_dmaiperf_start (): /GstPipeline:pipeline0/GstDmaiperf: dmaiperf0: Engine name not specified, not printing DSP information Setting pipeline to PLAYING ...

New clock: GstAudioSrcClock ERROR: from element /GstPipeline:pipeline0/GstTIVidenc1:tividenc10: failed to cr eate video encoder: h264enc

Additional debug info: gsttividenc1.c(1272): gst_tividenc1_codec_start (): /GstPipeline:pipeline0/GstTI Videnc1:tividenc10 Execution ended after 482940673 ns. Setting pipeline to PAUSED ...

Setting pipeline to READY ...

Setting pipeline to NULL ...

Freeing pipeline ...


  • Hi Peng,
     
     
     As per my understanding your are not able to exercise CBR-mode to meet target bitRate of 1500000 in DM3730 dvsdk version 4_02_00_06 h264 encoder. 
     
     I have looked at source code for rateControlPreset mapping from user input (gstreamer command line input) to internal codec specific parameter rateControlPreset.   
     Please see function gst_tividenc1_codec_start() in file gstreamer-ti_svnr919\src\gsttividenc1.c for following code snippet
     
      /* set the bit rate control preset */
      switch(videnc1->rateControlPreset) {
             case 1:
                 params.rateControlPreset = IVIDEO_NONE;
                 break;
             case 2:
                 params.rateControlPreset = IVIDEO_LOW_DELAY;
                 break;
             case 3:
                 params.rateControlPreset = IVIDEO_STORAGE;
                 break;
             default:
                 params.rateControlPreset = IVIDEO_NONE;
                 break;
        }
     
     
     Note that user input of 2 is mapped to preset of IVIDEO_LOW_DELAY which is not supported by 3730 encoder.
     This explains the encoder instance creation failure.
     
     For details on how to set VBR, CBR and constant qp encoding in 3730 encoder, please see H264_Encoder_DM3730_UserGuide.pdf.
     The encoder expects rateControlPreset=IVIDEO_USER_DEFINED for CBR mode of operation. (as explained in userguide)
     Keeping this is mind you can change the above switch case as follows :
     
     /* set the bit rate control preset */
       switch(videnc1->rateControlPreset) {
              case 1:
                  params.rateControlPreset = IVIDEO_NONE;
                  break;
              case 2:            
                  params.rateControlPreset = IVIDEO_USER_DEFINED; /* CBR mode for 3730 encoders. */
                  break;
              case 3:
                  params.rateControlPreset = IVIDEO_STORAGE;
                  break;
              default:
                  params.rateControlPreset = IVIDEO_NONE;
                  break;
        }
     
     Can you confirm if instance creation is successful after this change.
     
     Note1 : you can make this switch case dependent on videnc1->device==Cpu_Device_DM3730 is true and if Platform_dm3730 is defined.
     Note2 : As regards to params.encodingPreset, the only preset supported is XDM_DEFAULT. In XDM_DEFAULT mode you will still be able to exercise all the extended parameters and control calls explained in userguide.
      

    Regards,
    Jay
     
     

  • Hi Jay

         Thanks!

         I will Trying it(  params.rateControlPreset = IVIDEO_USER_DEFINED), after this change!

     

     Regards,
     peng

  • Hi Jay

         Thanks!  After this change is successful!

        There is Other Problem ,The  Record H.264 Video snap and flash!  Please see my upload samplefile!

       Regards,

       Peng

  • Hi peng

    I want to know how to use the gstreamer in the dvsdk

    I find that you are good to your examples, but I can not find the related document (gstreamer)

    please help me,Thanks!

  • hi jay liyang

    1. The dvsdk has included a Gstreamer with DSP encoder/decoder

    2.gstreamer.freedesktop.org is The Gstreamer site.

  • hi peng

    Thank you for your fast reponse.

    Now I have displayed the color video image . but I want to change to white and black image ,you know how to do ti?

    I use the YUV format, I think that  I must move the U and V signal,and reserve the Y signal,  is it ok?  How to move the both?

    Hope you help!

    jay yang 

  • hi peng

    you have posted  the send command, do you share the receive command lines ?

    I find  a good website about TI's gstreamer plug, as followed,

    http://processors.wiki.ti.com/index.php/GstTIPlugin_Elements

    Thanks!

    jay yang