Why is the H.265 encoding much faster than H.264 in MMAPI?

Hi,

We encode H.264 and H.265 in MMAPI, and find the H.265 encoding much faster than H.264. The H.265 encoding can up to 200 fps, but the H.264 only up to 140 fps, the video resolution is 1080p, both in slow preset.

I test it by 01_video_enocde as follows:

1.H.265

time ./video_encode /run/testa265.yuv 1920 1080 H265 1.265 -br 2000000 -p main -rc vbr -hpt 4
Failed to query video capabilities: Inappropriate ioctl for device
NvMMLiteOpen : Block : BlockType = 8
===== MSENC =====
NvMMLiteBlockCreate : Block : BlockType = 8
892744264
842091865
===== NVENC blits (mode: 1) into block linear surfaces =====
Could not read complete frame from input file
File read complete.
App run was successful frame cnt:1287

real 0m6.262s
user 0m3.568s
sys 0m2.380s

2.H.264

time ./video_encode /run/testa265.yuv 1920 1080 H264 1.264 -br 2000000 -p high -rc vbr -hpt 4
Failed to query video capabilities: Inappropriate ioctl for device
NvMMLiteOpen : Block : BlockType = 4
===== MSENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
875967048
842091865
===== MSENC blits (mode: 1) into tiled surfaces =====
Could not read complete frame from input file
File read complete.
App run was successful frame cnt:1287

real 0m8.866s
user 0m4.012s
sys 0m3.264s

The yuv file have 1287 fames, it is stored in “/run/”, this path is in RAM.

I have some questions:

  1. Why is the H.265 encoding much faster than H.264?
    2.Is the h.265 encoder not set to the highest quality mode (slow preset)? I worry affects encoding quality.

Is there any advice?
Thanks!

Hi zcs:

  1. Why is the H.265 encoding much faster than H.264?

    Even H264&H265 choose “slow” preset, but we don’t have different preset options for “slow” between h264&h265.
    so it cause H265 encoding much faster.

2.Is the h.265 encoder not set to the highest quality mode (slow preset)? I worry affects encoding quality.

Yes, we are still investigating next step for this. will update on this topic.

Hi waynezhu:

Thank you for your reply.

I am looking forward this update.

ZCS,
We found it is caused by h264 intra4*4 is slower than h265.
We are still in debug, will let you know once have solution.

Hi waynezhu:

Thank you for your info.