Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing encoder bit rate and framerate
#1
Is there a way to change the H264 encoder bitrate while it is running?  I would like to adjust the bit rate when in constant bit rate mode.  I see the 'AW_MPI_VENC_SETRcParam' API has been commented out.  Is there another way to do it?

Does the AW_MPI_VENC_SetFrameRate function work while the encoder is running?

If I wanted to change the bitrate and/or framerate, do I just stop receiving pictures or do I have to reset the encoder?
Reply
#2
Use this API ERRORTYPE AW_MPI_VENC_SetChnAttr(VENC_CHN VeChn, const VENC_CHN_ATTR_S *pAttr)
typedef struct VENC_CHN_ATTR_S
{
VENC_ATTR_S VeAttr; /*the attribute of video encoder*/
VENC_RC_ATTR_S RcAttr; /*the attribute of rate ctrl*/
}VENC_CHN_ATTR_S;
typedef struct VENC_RC_ATTR_S
{
VENC_RC_MODE_E mRcMode; /*the type of rc*/
union
{
VENC_ATTR_H264_CBR_S mAttrH264Cbr;
VENC_ATTR_H264_VBR_S mAttrH264Vbr;
VENC_ATTR_H264_FIXQP_S mAttrH264FixQp;
VENC_ATTR_H264_ABR_S mAttrH264Abr;
VENC_ATTR_H264_QPMAP_S mAttrH264QpMap;
VENC_ATTR_MPEG4_CBR_S mAttrMpeg4Cbr;
VENC_ATTR_MPEG4_FIXQP_S mAttrMpeg4FixQp;
VENC_ATTR_MPEG4_VBR_S mAttrMpeg4Vbr;
VENC_ATTR_MJPEG_CBR_S mAttrMjpegeCbr;
VENC_ATTR_MJPEG_FIXQP_S mAttrMjpegeFixQp;
VENC_ATTR_MJPEG_VBR_S mAttrMjpegeVbr;
VENC_ATTR_H265_CBR_S mAttrH265Cbr;
VENC_ATTR_H265_VBR_S mAttrH265Vbr;
VENC_ATTR_H265_FIXQP_S mAttrH265FixQp;
VENC_ATTR_H265_ABR_S mAttrH265Abr;
VENC_ATTR_H265_QPMAP_S mAttrH265QpMap;
};
void* pRcAttr ;
}VENC_RC_ATTR_S;

if u use h264 CBR,set bitrate in this
VENC_ATTR_H264_CBR_S

typedef struct VENC_ATTR_H264_CBR_S
{
unsigned int mGop;
unsigned int mStatTime;
unsigned int mSrcFrmRate;
unsigned int fr32DstFrmRate ;
unsigned int mBitRate;
unsigned int mFluctuateLevel;
} VENC_ATTR_H264_CBR_S;

here unsigned int mBitRate;
Reply
#3
(09-20-2018, 12:36 AM)tylerjbrooks Wrote: Is there a way to change the H264 encoder bitrate while it is running?  I would like to adjust the bit rate when in constant bit rate mode.  I see the 'AW_MPI_VENC_SETRcParam' API has been commented out.  Is there another way to do it?

Does the AW_MPI_VENC_SetFrameRate function work while the encoder is running?

If I wanted to change the bitrate and/or framerate, do I just stop receiving pictures or do I have to reset the encoder?

Does the AW_MPI_VENC_SetFrameRate function work while the encoder is running?

Yes
Reply
#4
Thank you Michael.

I had considered using AW_MPI_VENC_SetChnAttr but thought it was a little heavy.  It does reset all the encoder channel attributes.  However, I will give it a try.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)