这边博客主要记录在预研quick sync中涉及到的一些性能质量相关的关键参数设置。

github: https://github.com/MarkRepo/qsve

1. VPP处理过程伪代码:

MFXVideoVPP_QueryIOSurf(session, &init_param, response);
allocate_pool_of_surfaces(in_pool, response[].NumFrameSuggested);
allocate_pool_of_surfaces(out_pool, response[].NumFrameSuggested);
MFXVideoVPP_Init(session, &init_param);
in=find_unlocked_surface_and_fill_content(in_pool);
out=find_unlocked_surface_from_the_pool(out_pool);
for (;;) {
  sts=MFXVideoVPP_RunFrameVPPAsync(session,in,out,aux,&syncp);
  if (sts==MFX_ERR_MORE_SURFACE || sts==MFX_ERR_NONE) {
    MFXVideoCore_SyncOperation(session,syncp,INFINITE);
    process_output_frame(out);
    out=find_unlocked_surface_from_the_pool(out_pool);
  }   if (sts==MFX_ERR_MORE_DATA && in==NULL) break;
  if (sts==MFX_ERR_NONE || sts==MFX_ERR_MORE_DATA) {
    in=find_unlocked_surface(in_pool);
    fill_content_for_video_processing(in);
    if (end_of_input_sequence()) in=NULL;
  }
} MFXVideoVPP_Close(session);
free_pool_of_surfaces(in_pool);
free_pool_of_surfaces(out_pool);

2.Encoder处理过程伪代码:

MFXVideoENCODE_QueryIOSurf(session, &init_param, &request);
allocate_pool_of_frame_surfaces(request.NumFrameSuggested);
MFXVideoENCODE_Init(session, &init_param);
sts=MFX_ERR_MORE_DATA;
for (;;) {
  if (sts==MFX_ERR_MORE_DATA && !end_of_stream()) {
    find_unlocked_surface_from_the_pool(&surface);
    fill_content_for_encoding(surface);
  }   surface2=end_of_stream()?NULL:surface;
  sts=MFXVideoENCODE_EncodeFrameAsync(session,NULL,surface2,bits,&syncp);
  if (end_of_stream() && sts==MFX_ERR_MORE_DATA) break;
  … // other error handling
  if (sts==MFX_ERR_NONE) {
    MFXVideoCORE_SyncOperation(session, syncp, INFINITE);
    do_something_with_encoded_bits(bits);
  }
}
MFXVideoENCODE_Close();
free_pool_of_frame_surfaces();

3. Lowlatency 低延时参数设置:

//Encoder参数设置:
m_mfxEncParams.mfx.GopRefDist = ;  
m_mfxEncParams.AsyncDepth = ;
m_mfxEncParams.mfx.NumRefFrame = ; //Vpp参数设置:
m_mfxVppParams.AsyncDepth = ;

4. Quality 编码质量相关参数:

m_mfxEncParams.mfx.TargetKbps    //  码率越高,质量越好, 流量越大
m_mfxEncParams.mfx.TargetUsage // 1~7 质量从高到低, 流量几乎不变,质量变化不明显

5.SPS PPS信息(开始一个新的编码序列)

//获取当前参数设置  
mfxVideoParam par;
memset(&par, , sizeof(p ar));
sts = m_pMfxEnc->GetVideoParam(&par);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); //设置编码器扩展选项,开始一个新序列
mfxExtEncoderResetOption resetOption;
memset(&resetOption, , sizeof(resetOption));
resetOption.Header.BufferId = MFX_EXTBUFF_ENCODER_RESET_OPTION;
resetOption.Header.BufferSz = sizeof(resetOption);
resetOption.StartNewSequence = MFX_CODINGOPTION_ON;
mfxExtBuffer* extendedBuffers[];
extendedBuffers[] = (mfxExtBuffer*) & resetOption;
par.NumExtParam = ;
par.ExtParam = extendedBuffers;
sts = m_pMfxEnc->Reset(&par);
MSDK_CHECK_RESULT(sts,MFX_ERR_NONE,sts); //手动设置编码参数
mfxEncodeCtrl curEncCtrl;
memset(&curEncCtrl, , sizeof(curEncCtrl));
curEncCtrl.FrameType = MFX_FRAMETYPE_I | MFX_FRAMETYPE_REF | MFX_FRAMETYPE_IDR;
sts = m_pMfxEnc->EncodeFrameAsync(&curEncCtrl, &m_pVPPSurfacesVPPOutEnc[nEncSurfIdx], &m_mfxBS, &syncpEnc);

6. 运行环境依赖的rpm

 libdrm, libdrm-devel, libva, intel-linux-media, kmod-ukmd(内核模块), libippcc.so, libippcore.so,(libippcc.so 会根据cpu型号依赖不同的动态库,如E3 1275 依赖libippccl9.so, i5 6400 依赖libippccy8.so)

7. 剩下的细节参考github上的源代码,稍后把代码放到github上管理起来。

Intel Quick Sync Video Encoder 2的更多相关文章

  1. Intel Quick Sync Video Encoder

    本篇记录Intel E3 1275处理器集成显卡的硬编码预研过程. 步骤如下: (1)环境搭建 (2)demo编译,测试 (3)研究demo源码,Media SDK API使用 (4)编写so动态库封 ...

  2. H.264转码加速:NVENC大战Quick Sync

    GPU加速技术对普通消费者最直观的影响就是视频转码应用上了,NVIDIA..AMD以及Intel都有自己的加速技术,而在新一代CPU和GPU架构上,三方都有更新的技术方案.<br>< ...

  3. H.265 Video Encoder IP Core

    复制: 开源H.265硬件视频编码器H.265 Video Encoder IP Core是开源的H.265硬件视频编码器,实现了H.265(或叫HEVC)的大部分功能. 它由复旦大学专用集成电路与系 ...

  4. H.265 HD 和H.265 4K Video Encoder IP Core

    H.265 HD 和H.265 4K Video Encoder IP Core H.265 HD Video Encoder IP Core(H.265 HD Video/Audio Encoder ...

  5. Intel Media SDK H264 encoder GOP setting

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

  6. Getting Started with the Intel Media SDK

    By Gael Hofemeier on March 19, 2015 Follow Gael on Twitter: @GaelHof Media SDK Developer’s Guide Med ...

  7. Intel® Media SDK(一)

    A cross-platform API for developing media applications on Windows* Fast video playback, encode, proc ...

  8. Intel 处理器架构演进 转

    Intel 处理器架构演进  Posted on 2018-02-13 |  Edited on 2018-09-23 |  In Computer Architecture |  Comments: ...

  9. Intel® Core™ i5-5300U Processor

    3M Cache, up to 2.90 GHz Specifications Ordering and Compliance Essentials     Product Collection 5t ...

随机推荐

  1. DelphiXe 中静态数组TByteArray和动态数组TBytes /array of byte 的区别

    在应用中发现静态数组和动态数组是有区别的: procedure TForm1.Button1Click(Sender: TObject);var  RsltStream: TMemoryStream; ...

  2. C/C++中字符串与数字之间的转换

    主要有两种方式:C 中能够使用 sprintf 将数字转为字符数组,sscanf 将字符数组转为数字:而在 C++ 中不仅能够使用 C 中的方法,还能够使用 stringstream 实现字符串与数字 ...

  3. 将Latex tex文档转换成 word文档(下)

    在上篇中我们介绍了一款将 tex 文件转换成 word 文件的工具 借用万能的搜索引擎,在 Google 上找到了更好的工具 它就是Pandoc 介绍 Pandoc 是由 John McaFarlan ...

  4. lower_bound() 与 upper_bound()

    1. lower_bound() lower_bound()是泛型算法,在使用时,需要先将序列进行排序: 作用:  函数lower_bound()在first和last中的前闭后开区间进行二分查找,返 ...

  5. 分享牛人就是的volatilekeyword

    volatile作用 一个定义为volatile的变量是说这变量可能会被意想不到地改变.这样,编译器就不会去如果这个变量的值了. 精确地说就是.优化器在用到这个变量时必须每次都小心地又一次读取这个变量 ...

  6. 前台freemark获取后台的值

    1.后台代码: ModelAndView mv = new ModelAndView("log/logList.ftl"); String info="abc" ...

  7. xcode下载低版本模拟器速度缓慢解决方案

    随着苹果系统的更新和迭代,现在app开发中需要适配的除了需要适配屏幕尺寸以外,还需要适配系统版本.系统版本测试如果有条件可以使用各种系统版本的真机进行适配,如果没有这个条件,也可以采用xcode的模拟 ...

  8. VS2012删除选项卡菜单中的"关闭所有文档"

    delete the "close all documents" item of tab menu in vs2012 Tools -> Customize -> Co ...

  9. 配置Nginx防止直接用IP訪问Webserver

    看了非常多Nginx的配置,好像都忽略了ip直接訪问Web的问题.这样理论上不利于SEO优化,所以我们希望能够避免直接用IP訪问站点.而是域名訪问.详细怎么做呢.看以下. 官方文档中提供的方法: If ...

  10. mysql 优化下

    比较全面的MySQL优化参考(下篇) 8条回复 本文整理了一些MySQL的通用优化方法,做个简单的总结分享,旨在帮助那些没有专职MySQL DBA的企业做好基本的优化工作,至于具体的SQL优化,大部分 ...