Media (Intel® Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
Announcements
The Intel Media SDK project is no longer active. For continued support and access to new features, Intel Media SDK users are encouraged to read the transition guide on upgrading from Intel® Media SDK to Intel® Video Processing Library (VPL), and to move to VPL as soon as possible.
For more information, see the VPL website.
3075 Discussions

How could I do to fully use IGP for h264 encoding by media sdk?

Gaiger_Chen
New Contributor I
1,267 Views

Hi :

I would like to use media sdk for encoding. The input data (about 300 frames) is pre-loaded to memory, so There is no bottleneck on loading data from hard disk. by the GPU-z, I could watch the gpu load. The gpu loading is 45%~49%, not 100% at all. (for 720p , 8Mbs the encoding speed is 145 FPS on HD 2000@i5 2410m )

Based on the gpu loading is not full, so there is room for enchaning encoding efficiency.
, what parameter I should use for this target ?

(there is no b frame, and zero-latency):

My current parameter are :

m_mfxEncParams.mfx.CodecId = MFX_CODEC_AVC;
m_mfxEncParams.mfx.TargetUsage = MFX_TARGETUSAGE_BEST_SPEED;

m_mfxEncParams.mfx.TargetKbps = (mfxU16)(8*1024); // in Kbps
m_mfxEncParams.mfx.MaxKbps = (mfxU16)(1.5*(unsigned int)m_mfxEncParams.mfx.TargetKbps);

m_mfxEncParams.mfx.RateControlMethod = MFX_RATECONTROL_VBR;
m_mfxEncParams.mfx.EncodedOrder = 0; // binary flag, 0 signals encoder to take frames in display order

m_mfxEncParams.mfx.GopOptFlag = MFX_GOP_CLOSED;//B-frames of the first B-interval can never reference the previous GOP
m_mfxEncParams.mfx.IdrInterval = 25; //specifies IDR-frame interval in terms of I-frames;
m_mfxEncParams.mfx.GopRefDist = 1; // Distance between I- or P- key frames, 1 :Disable B slices
m_mfxEncParams.mfx.GopPicSize = 1 + 150;

ConvertFrameRate((mfxF64)25, &m_mfxEncParams.mfx.FrameInfo.FrameRateExtN, &m_mfxEncParams.mfx.FrameInfo.FrameRateExtD);

m_mfxEncParams.IOPattern = MFX_IOPATTERN_IN_SYSTEM_MEMORY;

m_mfxEncParams.mfx.FrameInfo.FourCC = MFX_FOURCC_NV12;
m_mfxEncParams.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
m_mfxEncParams.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_PROGRESSIVE;



or othere parameters should be modify ?

thank you lots.
0 Kudos
8 Replies
Petter_L_Intel
Employee
1,267 Views
Hi Gaiger,

I'm not sure about the reliability of GPU-z. I would instead recommend using Intel Graphics Performance Analyzer (GPA) which can be downloaded from here:http://software.intel.com/en-us/articles/vcsource-tools-intel-gpa/
Using this tool you can see real-time GPU load via the GPA Monitor/Media Performance Tool.

You should be able to get your GPU loaded to ~100% using Media SDK encode sample by removing file reading of RAW yuv data. I did a quick test using your parameter settings and I see ~300fps and an overall GPU load of 95%.

I suspect your implementation may have additional CPU or file system bottleneck.

Also, for optimal performance please try to use video memory instead of system memory.

Regards,
Petter
0 Kudos
Gaiger_Chen
New Contributor I
1,267 Views

Hi Petter:

As your instruction, I have download the GPA 4.3 for analysis.

I have study it for a few hours, but I still do not know how to measure the GPU usage rate...

my step is :

1. I use GPA monitor to launch my appilcation (AA.exe).
2. when the 1. is running, I excute the GPA system analyzer..
3. there is a list on GPA system analyzer, that is AA.exe.
4. click the AA.exe on the list, there is page for report, I could drag the cpu number on the left to the right, to watch the cpu useage rate...

But there is no GPU usage....

May you help me ?

Another question, how do you do to let the gpu usage rate as 100%?

I just comment out the line

sts = m_FileReader.LoadNextFrame(pSurf); in pipeline_encode.cpp line 901 and line 911.

the gpu usage rate is 75% by gpu-z mesure.


May you tell me the detail ? thank you lots.

Liger

0 Kudos
Petter_L_Intel
Employee
1,267 Views
Hi,

to track GPU load using GPA just start the "Intel GPA Monitor". Then go to the taskbar and right click on the "GPA Monitor" task bar icon. From the menu that opens select "Media Performance...".

Yes, the most straightforward way to eliminate reading the raw data from the file system is to just remove LoadNextFrame. Naturally this also means that you will be encoding blank surfaces.

Regards,
Petter
0 Kudos
Gaiger_Chen
New Contributor I
1,267 Views
Petter :

thank you lots!!!!

By the way, the GPA seems could do analysis for non- intel graphics,

that is also good for nvidia graphics.

Liger

0 Kudos
Petter_L_Intel
Employee
1,267 Views
Hi Liger,

Unfortunately, the Intel GPA tool only works for Intel Graphics.

Regards,
Petter
0 Kudos
Gaiger_Chen
New Contributor I
1,267 Views
Petter:

Thank you, I would move the question to the GPA forum zone.

Liger
0 Kudos
irfan_k_
Beginner
1,267 Views

Dear Petter,

Hope you are doing well can you tell me from Encoder H.264 SD/HD Encoder HVE-02 how i transmit Mpeg 2 and Mpeg 4??

There is any Setting for that i use the Upcom Modulator DVbs&Dvbs2 ..

 

0 Kudos
Surbhi_M_Intel
Employee
1,267 Views

Hi Irfan,

Can you please explain the problem you are seeing with Media SDK in detail? or If you can explain the use case we might be able to give suggestions related to Media SDK.

-Surbhi

0 Kudos
Reply