libva icon indicating copy to clipboard operation
libva copied to clipboard

Status of MPEG-4 Part 2 (H.263) support in VA-API

Open lorn10 opened this issue 4 years ago • 2 comments

Hi there!

This is not a bug report. This is more a technical question regarding the current status of the MPEG-4 Part 2 standard in VA-API. As everybody knows, MPEG-4 Part 2 is the base of the once well-known Xvid and DivX codecs. ;-)

The MPEG-4 Part 2 standard was originally not included in VA-API. While several Linux howtos still describe it as "not supported" by VA-API, it is listed at other website, like Wikipedia, as supported. Unfortunately the libva NEWS document doesn't bring in this topic any clarity either.

So, what is the current status regarding the support of the MPEG-4 Part 2 (H.263) standard in VA-API (as of January 2021)?

I should clarify this question that I don't mean any "workaround implementation". A such one exits for example in the Mesa Gallium drivers. (On these it is possible enforce MPEG-4 Part 2 support with value VAAPI_MPEG4_ENABLED=true.)

lorn10 avatar Jan 16 '21 16:01 lorn10

sorry for late response. from my perspective , the question could be treated as 2 question:

  1. MPEG-4 Part2 decode support. it is not related with VAAPI, it depends on the implementation of backend driver. if you want use https://github.com/intel/media-driver as an example. the answer is no.
  2. MPEG-4 part2 encode support. it was not defined in VAAPI, so there are no any support. by the way, could you share some background? are there new usage?

XinfengZhang avatar Feb 01 '21 07:02 XinfengZhang

Thanks XinfengZhang for your replay.

Okay, so the answer is that VAAPI is theoretically able to support MPEG-4 Part2 (H.263) decoding when it is correctly implemented by the backend driver (and hardware).

Intel never supported H.263 decoding in their Quick Sync hardware cores. So MPEG-4 Part2 (H.263) is not available there.

However, AMD and NVIDIA both supports MPEG-4 Part2 (H.263) decoding in some of their video decoding ASICs. So with the corresponding driver support, MPEG-4 Part2 (H.263) decoding via VAAPI can be implemented. For example this can be seen at the Mesa Radeon Gallium drivers were some "beta status support" for H.263 decoding exists. (But first it must be enforced with the VAAPI_MPEG4_ENABLED=true parameter)

To cut a long story short, the often proposed statement "MPEG-4 is disabled by default due to VAAPI limitations" is wrong. (Can be found for example here: https://wiki.archlinux.org/index.php/Hardware_video_acceleration)

It should read correctly "MPEG-4 decoding through VAAPI is disabled by default due to backend driver limitations"

That's definitely a difference. ;-)

lorn10 avatar Feb 03 '21 20:02 lorn10