https://en.wikipedia.org/wiki/X264

x264 is able to use Periodic Intra Refresh instead of keyframes, which enables each frame to be capped to the same size enabling each slice to be immediately transmitted in a single UDP or TCP packet and on arrival immediately decoded.[15] Periodic Intra Refresh can replace keyframes by using a column of intra blocks that move across the video from one side to the other, thereby "refreshing" the image. In effect, instead of a big keyframe, the keyframe is "spread" over many frames. The video is still seekable: a special header, called the SEI Recovery Point, tells the decoder to "start here, decode X frames, and then start displaying the video." This hides the refresh effect from the user while the frame loads. Motion vectors are restricted so that blocks on one side of the refresh column don't reference blocks on the other side, effectively creating a demarcation line in each frame.

https://community.freescale.com/thread/311299

ASK:

I am interested in using the i.MX6Q VPU to encode H.264 streams with intra-refresh enabled.  For this I looked up in the i.MX 6Dual/6Quad VPU Application Programming Interface Linux Reference Manual, Rev L3.0.35_4.0.0, 05/2013, page 24 where it states that setting the intraRefresh field to a non-zero value in EncOpenParam structure and passing to the vpu_EncOpen() API will enable intra-refresh:

intraRefresh where 0 = Intra MB refresh is not used. Otherwise = At least N MB's in every P-frame are encoded as intra MB's. This value is ignored in for STD_MJPG.

So, following the above directions, I set intraRefresh to different non-zero values (800, 2400, etc) and encoded 1080 H.264 streams from the camera.  Upon examination of the streams, it looks likes there are still I-frames in the video.  I am under the impression that when intra-refresh parameter is enabled then there would be no I frames in the video, just P frames with the Intra MBs embedded within.

I am modifying vpu_wrapper.c from the 4.0.0 LTIB release.  In VPU_EncOpen(), I set sEncOpenParam.intraRefresh = 2400.  Also tried other values.

My question is why the VPU is still generating I-frames despite the intra-refresh option set?

Also whether there are other options I need to enable/modify to get this to encode properly?

ANSWER:

The parameter intraRefresh only affect the P frame, it isn't related with I frame.

If you want to encode clip with rare I frame, you can enlarge the I frame interval through assign one big GOP size.

gopSize is the GOP size, where 0 means only first picture is I; 1 means all I pictures, 2 = IPIP, 3 = IPPIPP, and so on. The maximum value is 32,767, but in practice, a smaller value should be chosen by the application for proper error concealment. This value is ignored for STD_MJPG.

https://community.freescale.com/thread/321537

what is right configuration of iMX53 vpu of freescale that can generate h264 vedio stream with constant bitrate?

I'm using the mx53 vpu(and will use imx6Q) to encode VGA pictures(yuv420) to h264 vedio stream.  After vpu encodes one frame,  we send related h264 datas using wirless network to another dev. Because the wireless bandwidth is limited to an constant value , we hope the h264 bitrate can be or most nearly  a constant value "400Kb".  My configurations of the vpu are as follows. Howerver ,we mornitored the network's bitrate, the vpu's bitrate isn't an constant, it changes from 100kb to 800kb,  also the video quality is much more worse than vedio from TI's dm365 which generates h264 vedio stream with the same bitrate .
Can anyone help me to check which parameter is not right or how to config the vpu to get constant bitrate with high vedio quality ?
Thanks !! encConfig.stdMode = STD_AVC;
encConfig.picWidth=;
encConfig.picHeight=;
encConfig.encWidth=;
encConfig.encHeight=;
encConfig.offsetX=;
encConfig.offsetY=;
encConfig.bitRate =; //bitrate set here ,but not working
encConfig.rotatedAngle=; //rotate
encConfig.initialDelay=; // no use for h264
encConfig.vbvBufferSize=; //initial delay==0 , delay this param
encConfig.frameRate=; //
encConfig.gopsize =; // 0 is 仅第一帧为I; 1 is IIIIII; 2 is IPIPIP; 3 is IPPIPPIPP; 4 is IPPPIPPPIPPP,...
encConfig.enableAutoSkip= ; //skipe encode
encConfig.intraRefresh =; // 0 - Intra MB refresh is not used.
encConfig.rcIntraQp=(); //26, default, Quantization parameter for I frame.
encConfig.annexJ =;
encConfig.annexK =;
encConfig.annexT =;
encConfig.quantparam =; //vbr 0-51for 264, 1 ~ 31 for MPEG-4 // Fill parameters for encoding.
encOP.bitstreamBuffer = g_BitstreamPhy;
encOP.bitstreamBufferSize = 0x100000;
encOP.bitstreamFormat = encConfig.stdMode;
encOP.frameRateInfo = encConfig.frameRate;
encOP.bitRate = encConfig.bitRate;
encOP.initialDelay = encConfig.initialDelay;
encOP.vbvBufferSize = encConfig.vbvBufferSize; // 0 = ignore
encOP.gopSize = encConfig.gopsize; // only first picture is I
encOP.slicemode.sliceMode = ; // 0:1 slice per picture, 1: multi slice
encOP.slicemode.sliceSizeMode = ;
encOP.slicemode.sliceSize = ;//
encOP.intraRefresh = encConfig.intraRefresh;
encOP.rcIntraQp = encConfig.rcIntraQp;
encOP.userQpMax = ; //default 1 szj change
encOP.userQpMin = ;
encOP.userQpMinEnable = ;
encOP.userQpMaxEnable = ;
encOP.userGamma = ;
encOP.RcIntervalMode = ;
encOP.MbInterval = ;
encOP.interleavedCbCr = ;
encOP.avcIntra16x16OnlyModeEnable = ;
encOP.picWidth = encConfig.picWidth;
encOP.picHeight = encConfig.picHeight;
encOP.encWidth = encConfig.encWidth;
encOP.encHeight = encConfig.encHeight;
encOP.offsetX = encConfig.offsetX;
encOP.offsetY = encConfig.offsetY;
encOP.rotationAngle = encConfig.rotatedAngle; if (encConfig.stdMode == STD_MPEG4)
{
encOP.EncStdParam.mp4Param.mp4_dataPartitionEnable = ;
encOP.EncStdParam.mp4Param.mp4_reversibleVlcEnable = ;
encOP.EncStdParam.mp4Param.mp4_intraDcVlcThr = ;
encOP.EncStdParam.mp4Param.mp4_hecEnable = ;
encOP.EncStdParam.mp4Param.mp4_verid = ;
} if (encConfig.stdMode == STD_AVC)
{
encOP.EncStdParam.avcParam.avc_constrainedIntraPredFlag = ;
encOP.EncStdParam.avcParam.avc_disableDeblk = ;
encOP.EncStdParam.avcParam.avc_deblkFilterOffsetAlpha = ;
encOP.EncStdParam.avcParam.avc_deblkFilterOffsetBeta = ;
encOP.EncStdParam.avcParam.avc_chromaQpOffset = ;
encOP.EncStdParam.avcParam.avc_audEnable = ;
encOP.EncStdParam.avcParam.avc_fmoEnable = ;
encOP.EncStdParam.avcParam.avc_fmoType = ;
encOP.EncStdParam.avcParam.avc_fmoSliceNum = ;
encOP.EncStdParam.avcParam.avc_fmoSliceSaveBufSize = MAX_FMO_SLICE_SAVE_BUF_SIZE;
}
encOP.ringBufferEnable = ;
encOP.dynamicAllocEnable = ;
encOP.picWidth = (encOP.picWidth + ) & ~;
encOP.picHeight = (encOP.picHeight + ) & ~;
YFrameSize = encOP.picWidth * encOP.picHeight;
srcFrameIdx = initialInfo.minFrameBufferCount; exit_t = ;
frameIdx = ;
encParam.sourceFrame = &frameBuf[srcFrameIdx];
encParam.quantParam = encConfig.quantparam;
encParam.forceIPicture = ; //default 0
encParam.skipPicture = ;
encParam.enableAutoSkip = encConfig.enableAutoSkip;

Intra Refresh of H264 encoder的更多相关文章

  1. Intel Media SDK H264 encoder GOP setting

    1 I帧,P帧,B帧,IDR帧,NAL单元 I frame:帧内编码帧,又称intra picture,I 帧通常是每个 GOP(MPEG 所使用的一种视频压缩技术)的第一个帧,经过适度地压缩,做为随 ...

  2. Using Live555 to Stream Live Video from an IP camera connected to an H264 encoder

    http://stackoverflow.com/questions/27279161/using-live555-to-stream-live-video-from-an-ip-camera-con ...

  3. (转)x264代码详细阅读之x264.c,common.c,encoder.c

    转自:http://alphamailpost.blog.163.com/blog/static/201118081201281103931932/ x264代码详细阅读第一之x264.chttp:/ ...

  4. H.264视频的RTP荷载格式

    Status of This Memo This document specifies an Internet standards track protocol for the   Internet ...

  5. ffmpeg最全的命令参数

    Hyper fast Audio and Video encoderusage: ffmpeg [options] [[infile options] -i infile]... {[outfile ...

  6. x264源代码简单分析:x264命令行工具(x264.exe)

    ===================================================== H.264源代码分析文章列表: [编码 - x264] x264源代码简单分析:概述 x26 ...

  7. ffmpeg中的x264编码选项,对应关系

    )’ Disabled. ‘variance (1)’ Variance AQ (complexity mask). ‘autovariance (2)’ Auto-variance AQ (expe ...

  8. 18、x264编码在zedboard上的实现(软编码)

    一.x264开源包获取 x264-snapshot提供了开源x264源代码,已经在X86和ARM架构下均已实现.linux下可以使用git获得最新的代码包 git clone git://git.vi ...

  9. x264源代码简单分析:编码器主干部分-2

    ===================================================== H.264源代码分析文章列表: [编码 - x264] x264源代码简单分析:概述 x26 ...

随机推荐

  1. Samza文档翻译 : Backgroud

    这一页提供了关于流处理的背景知识,描述什么是Samza,以及它为何而生. what is messaging?什么叫消息? 消息系统是用来实现近实时异步计算的一种流行方式.当事件发生时,消息可以被放在 ...

  2. firefly笔记一之http模块

    原地址:http://www.9miao.com/question-15-54380.html Firefly是免费开源的游戏服务器端框架,开发语言是python,基于twisted框架开发,作为一名 ...

  3. IText 生成横向的doc文档

    IText生成doc文档需要三个包:iTextAsian.jar,iText-rtf-2.1.4.jar,iText-2.1.4.jar 亲测无误,代码如下: import com.lowagie.t ...

  4. 93. Restore IP Addresses

    题目: Given a string containing only digits, restore it by returning all possible valid IP address com ...

  5. poj2186Popular Cows(强连通分量)

    http://poj.org/problem?id=2186 用tarjan算出强连通分量的个数 将其缩点 连成一棵树  则题目所求即变成求出度为0 的那个节点 在树中是唯一的 即树根 #includ ...

  6. Web请求响应简单整理

      简单对Web请求响应如何处理进行的整理,难免有理解不到位,理解有偏差的地方,如有理解有误的地方,希望大牛批评指正. 1.Web开发的定义首先看看微软对Web开发的定义:Web开发是一个指代网页或网 ...

  7. apache开源项目--PDFBox

    PDFBox是Java实现的PDF文档协作类库,提供PDF文档的创建.处理以及文档内容提取功能,也包含了一些命令行实用工具. 主要特性包括: 从PDF提取文本 合并PDF文档 PDF 文档加密与解密 ...

  8. c语言中较常见的由内存分配引起的错误_内存越界_内存未初始化_内存太小_结构体隐含指针

    1.指针没有指向一块合法的内存 定义了指针变量,但是没有为指针分配内存,即指针没有指向一块合法的内浅显的例子就不举了,这里举几个比较隐蔽的例子. 1.1结构体成员指针未初始化 struct stude ...

  9. 【转】Angular运行原理揭秘 Part 1

    当你用AngularJS写的应用越多, 你会越发的觉得它相当神奇. 之前我用AngularJS实现了相当多酷炫的效果, 所以我决定去看看它的源码, 我想这样也许我能知道它的原理. 下面是我从源码中找到 ...

  10. Ext入门学习系列(二)弹出窗体

    第二章 弹出窗体 上节学习了Ext的环境搭建和最基本的一个操作——弹出对话框,作为一个引子,本节讲述如何弹出一个新窗体,从实例讲解Ext的基本运行原理. 一.Ext的窗体长什么样? 先来看看几个效果, ...