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.

Dose DM368 support dynamic encoder resolution change?

Hi,

I want change the DM368 encoder width/height and bitrate when running. Does it support this scenario? If yes, could anyone tell me what interface should be used?

For example, I created a encoder with initial parameter: width 1280, height 720, bitrate 2M. After running for a while, I want to reduce the bitrate because of the network issues. When the bitrate is reduce to some extent, I must adjust the resolution. It may be changed to 352x288. 

I only found that the resolution can be set in ALG_VidEncCreate. When encoder is started, I can only control the encoder via ALG_VidEncRunPrm. But there is no resolution field in ALG_VidEncRunPrm.

Any suggestion??

Thanks in advance,

Jeff

  • Jeff,

    From internal codec interface(XDM) perspective, this feature is indeed there. One can change the codec resolution runtime. I will check how this feature is mapped at the higher codec layer. I believe you are using DMAI ?

    regards

    Yashwant

  • Yashwant,

    Thanks for your replay. I think I'm using XDM interface, instead of DMAI. 

    The example is from TI-IPNC-DM36x 2.6.0 SDK. They are using the interface directly from dm365_codecs_01_00_06, included the header file ih264venc.h for encoder, ih264vdec.h for decoder. The codecs are downloaded from http://software-dl.ti.com/dsps/dsps_public_sw/codecs/DM36x/index_FDS.html. The encoder version is H264ENC.version.02.20.00.05, the decoder version is 02.00.00.11. The interfaces are like:

        VIDENC1_create (...)

        VIDENC1_control (...)

        VIDENC1_process (...)

    Just noticed that the resolution might be changed dynamically via VIDENC1_control() with IH264VENC_DynamicParams::inputHeight and inputWidth, is it right? Can it be called runtime? For now, it is called only when creating encoder.

    In addition, the same issue existed in the decoder. Does it support dynamic resolution change? If yes, what should I do? I noticed that it couldn't decoder the stream with the variable resolutions for now.

    Thanks again,

    Jeff

     

  • Just noticed this link: http://processors.wiki.ti.com/index.php/DM36x_H.264_encoder_FAQ#How_to_change_resolution_dynamically_in_H.264_encoder.3F. It can answer my question.

    But for the decoder, what should I do?

    Jeff

  • Jeff,

     

    For H.264 decoder, run time resoultion change may not be simple. I suggest below steps -

    1. When you want to close decoder 1, call control params with XDM_FLUSH

    2. Call process call till you get -1 as return from process call

    <This will free the buffers loacked by decoder >

    3. Then call XDM RESET

    4. Then again repeat the steps after create call, which includes a new call for XDM_GET_BUF_INFO and buffer manager reset.

    regards

    Yashwant

  • Thank you very much. I will be trying that ...

    Jeff

  • Hi Jeff,

    I am also looking to change encoder resolution run time.

    I tried as per post http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/100/t/194941.aspx

    I am getting VIDENC1_process() failed with error (-1 ext: 0x8006) error.

    When we change size at run time, is it require to change buf size ? what other settings require to do for runtime change of resolution ?

    Thanks,

    Rachit

  • Rachit,

    It doesn't need change buf size dynamically, but you must make sure that the buffer size is the maximum size and the width and height should be changed accordingly. 

    I suggest you can refer to Ih264venc.h. The error should be IH264VENC_ERR_IVIDENC1_INBUFS. And then you can look up the error in h264_encoder_dm365_userguide.pdf. The description is:

    This fatal error is returned in outArgs->extendedError if inBufs is null or if numBufs in inBufs is not set to 2 or if frameWidth and frameHeight in inBufs are not equal to inputWidth and inputHeight of XDM_SETPARAMS control call. Process call returns IVIDENC1_EFAIL.

    Hope that is helpful for you.

    Good luck,

    Jeff