JeffyCN / libv4l-rkmpp

A rockchip-mpp V4L2 wrapper plugin for chromium V4L2 VDA/VEA
GNU Lesser General Public License v2.1
79 stars 26 forks source link

Feature request: H265 decoding #2

Closed hfrappier closed 2 years ago

hfrappier commented 3 years ago

Chromium can be compiled to support HEVC demuxing in an MP4 container, and decoding via v4l2:

eg: on 73.0.3683.103:

#args.gn
enable_hevc_demuxing=true
// v4l2_video_decode_accelerator.cc (73.0.3683.103)
@@ -88,6 +88,9 @@ const uint32_t V4L2VideoDecodeAccelerator::supported_input_fourccs_[] = {
 #if !BUILDFLAG(USE_LINUX_V4L2)
     V4L2_PIX_FMT_VP9,
 #endif
+#if BUILDFLAG(ENABLE_HEVC_DEMUXING) && defined(V4L2_PIX_FMT_HEVC)
+    V4L2_PIX_FMT_HEVC,
+#endif
 };
JeffyCN commented 3 years ago

right, it's possible to enable hevc demuxer and add hevc format in v4l2 vda, but i haven't test that.(hevc support is mostly enabled in platform vda, e.g. android/vaapi)

adding hevc in this plugin is quite simple, just add the format here: https://github.com/JeffyCN/libv4l-rkmpp/blob/master/src/libv4l-rkmpp-dec.c#L31

if you can help to test it, i think it's ok to add that.

hfrappier commented 2 years ago

Which value would be required for the V4L2_PIX_FMT_HEVC case at: https://github.com/JeffyCN/libv4l-rkmpp/blob/master/src/libv4l-rkmpp-dec.c#L622

JeffyCN commented 2 years ago

same as h264 i guess, i was using it in other wrappers for a while, e.g. ffmpeg, gst-mpp

JeffyCN commented 1 year ago

FYI, since chrome has hevc hw decoder support in R104, i've added and tested it with meta-rockchip.

hfrappier commented 1 year ago

Awesome! Will this be tagged as 1.4.1?

JeffyCN commented 1 year ago

Awesome! Will this be tagged as 1.4.1?

i'm planing to increase the size limits(for newer chips), and switch to meson build system before new tag in next week.

hfrappier commented 1 year ago

Will this be configurable externally (for older chips)

JeffyCN commented 1 year ago

guessing it would failed (>4k on old chips) and fallback to sw decoder, which might not be usable anyway.

buy it's ok to make it configurable, i'll try to do so

JeffyCN commented 1 year ago

uploaded 1.5.0