Hello,
I'm writing a simple video server, which has to be able among others to capture, encode and recode video at the same time. The application will run on dm365. System is based on dvsdk 4.02 and using codec engine. Unfortunately I'm fighting with codec creation.
I discovered that I'm able to create up to four h264 decoders for 1600x1200, the fifth call to VIDDEC2_create returns NULL. I can also create several encoders (I do not know the top limit). However there is a strange issue with order of these initializations.
For example I can do following sequence:
decoder_init(&octx1);
encoder_init(&ictx1);
decoder_init(&octx2);
encoder_init(&ictx2);
decoder_init(&octx3);
encoder_init(&ictx3);
decoder_init(&octx4);
encoder_init(&ictx4);
BUT if I swith the order to
encoder_init(&ictx1);
decoder_init(&octx1);
encoder_init(&ictx2);
decoder_init(&octx2);
(init encoder first) then the first decoder initialization fails immediatly on calling VIDDEC2_create, which returns NULL.
Each of my *_init() functions sets IVIDDEC2_Params, IVIDDEC2_DynamicParams, and calls VIDDEC2_create and VIDDEC2_control (or VIDENC2_create and VIDENC2_control respectively).
Does there exist any contstraint for codecs creation that I'm not aware of or there is some another problem?
I'm using following default params for the codecs:
static const VIDDEC2_Params Vdec2_Params_DEFAULT = {
sizeof(VIDDEC2_Params), /* size */
576, /* maxHeight */
720, /* maxWidth */
30000, /* maxFrameRate */
6000000, /* maxBitRate */
XDM_BYTE, /* dataEndianess */
XDM_YUV_420SP, /* forceChromaFormat */
};
static const VIDDEC2_DynamicParams Vdec2_DynamicParams_DEFAULT = {
sizeof(VIDDEC2_DynamicParams), /* size */
XDM_DECODE_AU, /* decodeHeader */
0, /* displayWidth */
IVIDEO_NO_SKIP, /* frameSkipMode */
IVIDDEC2_DISPLAY_ORDER, /* frameOrder */
0, /* newFrameFlag */
0, /* mbDataFlag */
};
static const VIDENC1_Params Venc1_Params_DEFAULT = {
sizeof(VIDENC1_Params), /* size */
XDM_DEFAULT, /* encodingPreset */
IVIDEO_LOW_DELAY, /* rateControlPreset */
1200, /* maxHeight */
1600, /* maxWidth */
30000, /* maxFrameRate */
6000000, /* maxBitRate */
XDM_BYTE, /* dataEndianness */
0, /* maxInterFrameInterval */
XDM_YUV_420P, /* inputChromaFormat */
IVIDEO_PROGRESSIVE, /* inputContentType */
XDM_CHROMA_NA /* reconChromaFormat */
};
static const VIDENC1_DynamicParams Venc1_DynamicParams_DEFAULT = {
sizeof(IVIDENC1_DynamicParams), /* size */
1200, /* inputHeight */
1600, /* inputWidth */
30000, /* refFrameRate */
30000, /* targetFrameRate */
6000000, /* targetBitRate */
30, /* intraFrameInterval */
XDM_ENCODE_AU, /* generateHeader */
0, /* captureWidth */
IVIDEO_NA_FRAME, /* forceFrame */
1, /* interFrameInterval */
0 /* mbDataFlag */
};
best regards
Jan