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.

a H.263 encode problem in 8168.


I use DVRRDK version 02.00.00.23 to test codec.
because DVRRDK do not support mpeg4 encoding and h263 encoding,I add some code and integrate REL.500.V.MPEG4.E.SP.IVAHD.01.00.00.05 to enc link to let DVRRDK encoding mpeg4 and h.263.
the result is that the demo app in DVRRDK can generate mpeg4 bitstream ok.
when I modify some parameter to let demo app in DVRRDK generating H.263 bitstream,I meet some unexpected condition.
the condition is that the encoder generate mpeg4 bitstream.( the bitstream has 0x00 0x00 0x01 0xb6 in the payload, not 0x00 0x00 0x80)

I am sure that I set below setting in code.

staticParams->videnc2Params.profile = 3;
staticParams->videnc2Params.level = IMPEG4ENC_H263_LEVEL_70;
staticParams ->useShortVideoHeader = 1;

below is the other parameter.
    In struct IMPEG4ENC_Params
[m3video] videnc2Params.maxHeight=1152  videnc2Params.maxWidth=1408  videnc2Params.maxInterFrameInterval=0  videnc2Params.inputContentType=0
[m3video] videnc2Params.inputChromaFormat=9  videnc2Params.profile=3  videnc2Params.level=70  videnc2Params.encodingPreset=3
[m3video] interCodingParams.interCodingPreset=0  interCodingParams.intraCodingPreset=0 enableAnalyticinfo=0  videnc2Params.rateControlPreset=5
[m3video] rateControlParams.rateControlParamsPreset=1 rateControlParams.rcAlgo=0  videnc2Params.maxBitRate=24000  videnc2Params.inputDataMode=3
[m3video] videnc2Params.outputDataMode=3  sliceCodingParams.sliceCodingPreset=0 sliceCodingParams.sliceMode=0
        Int struct  IMPEG4ENC_DynamicParams
[m3video] videnc2DynamicParams.inputWidth=720  videnc2DynamicParams.inputHeight=576  videnc2DynamicParams.captureWidth=896  videnc2DynamicParams.targetBitRate=200000
[m3video] videnc2DynamicParams.targetFrameRate=30000  videnc2DynamicParams.interFrameInterval=0 videnc2DynamicParams.intraFrameInterval=30  videnc2DynamicParams.mvAccuracy=1
[m3video] videnc2DynamicParams.refFrameRate=30000  videnc2DynamicParams.ignoreOutbufSizeFlag=0
[m3video] rateControlParams.qpMin=1  rateControlParams.qpMax=31  rateControlParams.qpI=5  rateControlParams.qpP=5  rateControlParams.rcAlgo=0

after some research,I notice that the h263 should support some fixed image size.
H.263 supports for a limited set of picture sizes:
•    128x96
•    176x144
•    352x288
•    704x576
•    1408x1152

I input 720x576 Image to encoder. so I think that it may be factor of outputting mpeg4 bitstream.
When I try change image to 704x576, the encoder return -1 when application call
error = handle->fxns->ividenc.process((IVIDENC2_Handle) handle,
                                      inputBufDesc, outputBufDesc,
                                      (IVIDENC2_InArgs *) inArgs,
                                      (IVIDENC2_OutArgs *) outArgs);

the doc seem has no more explanation about h263 setting.
do anyone know how to solve this condition?
or
can anyone provide me a configuration file that can set encoder to output h263 bitstream?
Just like the attach file encoder.cfg(path is REL.500.V.MPEG4.E.SP.IVAHD.01.00.00.05\500.V.MPEG4.E.SP.IVAHD.01.00\IVAHD_001\Client\Test\TestVecs\Config\ ).
I will check my setting with the configuration file if I get a configuration of H263.

5488.encoder.cfg

  • hi

    about the encoder return -1 when application call
    error = handle->fxns->ividenc.process((IVIDENC2_Handle) handle,
                                          inputBufDesc, outputBufDesc,
                                          (IVIDENC2_InArgs *) inArgs,
                                          (IVIDENC2_OutArgs *) outArgs);

    it is ok after I modify ignoreOutbufSizeFlag=1.

    so the problem is only that the encoder generate mpeg4 bitstream when I set below setting.

    staticParams->videnc2Params.profile = 3;
    staticParams->videnc2Params.level = IMPEG4ENC_H263_LEVEL_70;
    staticParams ->useShortVideoHeader = 1;

    staticParams->videnc2Params.encodingPreset =XDM_USER_DEFINED;

    thansk

  • well,I find the solution by myself.

    just set staticParams->videnc2Params.size = sizeof(IMPEG4ENC_Params);

    than the staticParams ->useShortVideoHeader configuration can be set to encoder.