Add support for H265 encoded streams#648
Conversation
Adds H265 as a selectable video codec with software (x265enc), VAAPI (vah265enc), and NVENC (nvh265enc) pipeline paths in both the legacy pipeline builder and the RTPCodec definition. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The gstreamer-vaapi plugin suite (vaapih264enc) is superseded by the va plugin (vah264enc) in gst-plugins-bad. Switch to it and update the parameters accordingly: CBR instead of VBR for lower-latency streaming, key-int-max instead of keyframe-period, and target-usage instead of quality-level. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Thanks to elFarto/nvidia-vaapi-driver#427 I've managed to test the VAAPI for both new H.264 and H.265 legacy pipelines on my NVidia GPU. Fixes pushed, from my PoV this is ready to be merged. |
|
@jameskitt616 would you have time to test out this new h264 configuration if that works with your compose on your hardware? This should be enough, no need to even create a new neko version as the pipeline is configurable: - vaapih264enc rate-control=vbr bitrate=6144 keyframe-period=180 quality-level=7
+ vah264enc rate-control=cbr bitrate=6144 key-int-max=60 target-usage=7 |
Any idea why it works for the normal pipeline but it does not for the broadcast pipeline? EDIT: |
|
@jameskitt616 the error message you're seeing may mean a lot of things, because from my testing, the plugins "appear" as non-existent when they fail to initialize. Things that come to my mind:
Which brings me to a bit of an unrelated topic, but even for the broadcast setup, since your encoding pipeline effectively doesn't differ, I think it is a waste of resources to encode twice. It would be nice to just use "tee" and some "shmem handoff" plugin to the other pipeline. But I suppose that could bring other issues (i.e. with neko's pipeline management). Maybe idea for the future? Maybe already captured somewhere? |
|
Yeah about the double encoding issue, i already had a DM talk with @m1k1o that they also think this would make more sense than wasting the resources twice. Regarding my neko setup: i use the ghcr.io/m1k1o/neko/intel-firefox image (with an intel integrated iGPU or dedicated Intel ARC GPU), but i am currently not sure if i used the latest version or v3.0.11 |
Originally based on #117 , I went through the hassle and tuned the parameters to make it work. I've tested the software and NVidia encoder paths. The update to 3.1.0 made it even easier, with updated dependencies.
Note that H265 decoding is poorly supported in Linux browsers, but works fine on Android / Chrome or Mac. Part of the journey was trying to make it work in my desktop browser, but I've failed with my setup. That's also the reason I won't be using this myself at the moment, but maybe in near future? It is possible that with AMD GPU and Chrome it can be made functional. Anyway, I thought since it was already done, someone may appreciate this.
While trying to update the legacy pipelines with the H265 variants, I've discovered that the used VAAPI plugin was merged into GStreamer (plugins-bad) and is deprecated. I've tried to make it so that the result uses the new plugin and is mostly consistent with the rest of the H26x pipelines, but since I own an NVidia GPU, I can't try the VAAPI encoders (only VAAPI decoding driver is available for NVidia GPUs).
Possible resolutions: