GES performance with nvcodec

I am using GES to merge and output media slices via timelines, and I notice that when nvcodec is enabled (nvh264enc/nvh264dec), it’s twice as slow as via cpu. I can see the GPU being used using nvidia-smi, but it looks like using NVCODEC, GES does not seek when an inset is specified in the clip.

Thoughts? Thanks!

p.s. I am using the nvidia docker container, and with it ffmpeg is 10x faster than cpu…

Okay, I figured this out. As I thought it should be, it’s automatic as long as (a) the plugins are given higher rank and (b) your encoding profile is generic enough to match the properties of the gpu encoder. That said, it seems that there is no bitrate setting for nvh264enc, so it always generates an 8mbps stream, even for 360p rendering.

Anyone know a way around this?

Now have that figured out… I had to create a prs file with the name of the encoder being used, in this case GstNvH264Enc.prs (if you turn level 3 logging on, you’ll see it look for and not find the full file path).

In that file, I had to create a section, in my case named “my_presets” (name doesn’t matter here)… and this is what it looked like…

[presets]
version=1.0
element-name=GstNvH264Enc

[my_presets]
bitrate=1000
max-bitrate=1000

Then, in my code that sets the encoding profile, specifically in the EncodingVideoProfile, I had to use:

profile = GstPbutils.EncodingVideoProfile.new(
Gst.Caps.from_string(‘video/x-h264’),
‘my_presets’,
Gst.Caps.from_string(f”video/x-raw, width=(int){width}, height=(int){height}”),
0)

Which pulls the encoder-specific properties from the GstNvH264Enc.prs file [presets] section and applies them. Now it renders nicely at whatever rate I specify in the prs file…

Wish this example had been somewhere in the docs but happy that I could provide it.