您好!请问一下在DM365 DVSDK4.02中如何在H.264编码中插入IDR帧,demos中只有第一帧为IDR帧,如果第一帧数据丢失,就无法显示。请问一下如何在每隔25帧插入一帧IDR数据,确保视频能够正常显示!请给位指导。。。多谢!
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.
你好,
可以手动加入pps/sps使得I帧变为IDR帧。请多多关注TI wiki上的内容。
http://processors.wiki.ti.com/index.php/DM36x_Resource_Guide
7.How to generate the SPS/PPS info only in H264enc?
孟工,您好:
代码demo:dvsdk-demos_4_02_00_01
encode库版本:H264ENC.version.02.20.00.01.wizardversion.0.5.2
也就是下载ti-dvsdk_dm368-evm_4_02_00_06的默认代码库。
如果按照以下方法,我在创建编码器后执行以下步骤:
How to force Intra frames in H.264 encoder? It can be done using forceFrame parameter of dynamicParams. Set the following: SET dynamicParams.forceFrame = IVIDEO_IDR_FRAME; Call VIDENC1_control() for XDM_SETPARAMS. This will set Force IDR Frame parameter call VIDENC1_process(). This will generate an IDR frame
而并不执行以下步骤:
SET dynamicParams.forceFrame = IVIDEO_NA_FRAME; Call VIDENC1_control() for XDM_SETPARAMS. This will set the original parameters for encoding and remove force IDR frame. call VIDENC1_process(). This will resume normal encoding
printf( "dynParams->forceFrame=%d\n", dynParams->forceFrame );
encStatus.data.buf = NULL;
dynParams->forceFrame = IVIDEO_IDR_FRAME;//test for all IDR
printf( "dynParams->forceFrame=%d\n", dynParams->forceFrame );
status = VIDENC1_control(hEncode, XDM_SETPARAMS, dynParams, &encStatus);
而且,执行以上代码没有错误信息。
实际编码出来的视频文件仍然只有头部是一个SPS/PPS/IDR帧,后面都是I帧或P帧,也就是没有图像帧0x00 00 00 01 65的重复,只有文件开头有一个这样的字符串。
不知道是哪里设置不对?
谢谢:)
这个问题试过了。
只要每次process前都iocontrol设置一下就能够编码出IDR帧了。
ok了!