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.

How to dynamically change resolution of encoder?

Hi,

     In our use case, the resolution of encoder may be changed dynamically.  In McFW scheme, the bitrate, framerate,

force IDR frame, IP GOP of encoder can be set dynamically.  But how can we set the resolution of encoder dynamically?

Does anyone have any idea?

Thanks,

James

 

 

  • Hi James,

    When ever the resolution, frame rate or bitrate etc needs to be changed dynamically,

    control() call needs to be called for the codec to configure the new changed parameter and to take effect.

     

    Regards,

    Venugopala Krishna

  • Hi Venugopala,

         When intial set up, we can confige the resolution.  But when the program is running, we do not know

    how to change it.  It may to deal with the frame buffers. (May be the new resolution is larger.)  Now we use

    the RDK version is 01.01.00.04.  About the bitrate or framerate, we can use EncLink_codecSetBitrate() or

    EncLink_codecSetFps() to dynamically change it when the chain is running.  While about the resolution,

    we do not find this kind of API.  So, may be it is more complicated if we want to dynamically change

    resolution.  So, do you have any idea that what "processes" we should do if we want to dynamically

    change resolution? 

    Thanks,

    James

  • Hi James,

    The encoder instance needs to be created for the maximum sizes.(createParameters of maxWidth and maxHeight).

    Later what ever the change in resolution needs to be equal or less than the above dimensions. which is conveyed through (inputWidth and inputHeight parameters of dynamicParams).

    Coming to APIs in RDK, I dont think there is an API to change resolution as of today whereas for others it is existing like,

     

    EncLink_codecSetFps

    EncLink_codecSetBitrate

    EncLink_codecSetForceIDR

     

    Regards,

    Venu

  • Hello,

    Adding this missing API ( same as done with the other parameters), for changing dynamic resolution parameter will support this feature ?

    Regards,

    Ran

  • Hi James,

    With RDK version 01.01.00.04 , there is option to change the encoder resolution in Capture interface Vcap_setDynamicParamChn(), it will change the dynamic resolution of encoder input.

    You can test Option 9 in Capture Setting Menu.

    Ramprasad

     

     

  • Hi Ramprasad,

    Thanks for clarification.
    I think I finally understand how it all delves down to inputWidth,inputHeight of encLink_common. This is done with ipcFramesInLink change of System_FrameInfo *frmInfo, which is part of the frame header, and therefore there is no need for special API function for that.

    There is the following remark in IpcFramesInLink_copyFrameInfo function. Is the remark still relevant ?

    Thanks, Ran

    /* HACK HACK HACK !!! modify rtChInfoUpdate = TRUE once the
    next link support dynamic resolution change */
    frmInfo->rtChInfoUpdate = TRUE;//FALSE;