Community
cancel
Showing results for 
Search instead for 
Did you mean: 
yu__leon
Beginner
84 Views

advice on sample_encode program tuning for fast encoding speed

Hi there 

I am using media SDK 1.26 and its sample_encode program to do a real-time H.264 streaming application.  I would like to ask for some general advice on how to tune the encoding parameters for fast encoding speed. 

I am encoding at 1280x720 and 1920x1080, using software encoder; the typical frame rate of my application is about 10~15 fps. 

I have selected  MFX_TARGETUSAGE_BEST_SPEED and the input format for encoder is NV12.   What other configuration parameters can I look at to improve the encoding speed?  any suggestion is much appreciated. thank you.

 

0 Kudos
5 Replies
Ramashankar
New Contributor III
84 Views

Hi Yu,

Some basic things to achieve fast encoding:

1. set AsyncDepth to 1.

2. Avoid B frame encoding, use h264 baseline profile. B frame can cause additional latency of 1-2 frames in encoding.

3. Provide one complete frames in input to encoder in each call.

4. Set TargetUsage to MFX_TARGETUSAGE_BEST_SPEED in encoder param.

5. Though software encoding is also suffice to produce 1 h264 stream @15 fps, but if you can exploit hardware capability then it may slightly speed up. Of course hw encoding have its own pros n cons. So need to take decision as per your working scenario.

Artem_S_Intel
Employee
84 Views

If it is SW, the best way is to enable  multi-slice, it'll make encoder to run multiple slices in parallel.

yu__leon
Beginner
84 Views

Ramashankar wrote:

Hi Yu,

Some basic things to achieve fast encoding:

1. set AsyncDepth to 1.

2. Avoid B frame encoding, use h264 baseline profile. B frame can cause additional latency of 1-2 frames in encoding.

3. Provide one complete frames in input to encoder in each call.

4. Set TargetUsage to MFX_TARGETUSAGE_BEST_SPEED in encoder param.

5. Though software encoding is also suffice to produce 1 h264 stream @15 fps, but if you can exploit hardware capability then it may slightly speed up. Of course hw encoding have its own pros n cons. So need to take decision as per your working scenario.

thank you

yu__leon
Beginner
84 Views

Artem S. (Intel) wrote:

If it is SW, the best way is to enable  multi-slice, it'll make encoder to run multiple slices in parallel.

is this related to mfxInfoMFX.NumSlice setting?  or a group of parameters needs to be considered together?

Mark_L_Intel1
Moderator
84 Views

Hi Leon,

Ramashankar and Artem has very good advices and they are all correct, just try to summarize the general guide lines:

1. Choose HW mode instead of SW, Ramashankar's suggestions are based on HW mode.

2. SW mode works as a fallback if HW mode is not available because it is slower than HW mode.

3. In HW mode, you can use graphic memory as the internal buffer to save the time of copying, especially when you have multiple component(encoder, decoder, vpp) in the pipeline, this will speed up the processing speed.

4. Different use case could have different arguments to speed up. MSDK is designed to process multiple stream at the same time, it would be more efficient to to them in parallel.

Mark

Reply