Hardware video encoding on Verdin iMX95

Hi,

I am testing GStreamer on a Verdin iMX95 board with the multimedia image which seems to come with the base and good GStreamer plugins. Based on Current state of functionality on IMX95 verdin - Technical Support - Toradex Community I understand that hardware-based video encoding is available but I am not sure it is being used, are there any setup steps required or should it kick in automatically? My test pipeline looks like this:

gst-launch-1.0 videotestsrc is-live=true ! video/x
-raw,format=BGRA,width=1080,height=720,framerate=30/1 ! videoconvert ! v4l2h264e
nc ! h264parse ! fakesink

Thanks!

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


I don’t have specific information about hardware video encoding setup for the Verdin iMX95 in the available sources. The documentation I have access to covers other Toradex modules but doesn’t include specific details for the iMX95.

However, based on the information available for other iMX modules, I can provide some general guidance:

Hardware Encoder Detection

To verify if hardware encoding is being used, you can check available GStreamer elements:

# gst-inspect-1.0 | grep -e "encoder"

(1)

This will show you which encoders are available on your system.

Pipeline Considerations

Your pipeline using v4l2h264enc should utilize hardware acceleration if it’s available (1). The v4l2h264enc element is typically the hardware-accelerated H.264 encoder for V4L2-compatible devices.

Troubleshooting Steps

  1. Check element capabilities:
# gst-inspect-1.0 v4l2h264enc

(1)

  1. Enable debug output to see what’s happening:
export GST_DEBUG=2

(1)

  1. Verify the pipeline works with a simpler sink:
# gst-launch-1.0 videotestsrc ! videoconvert ! v4l2h264enc ! fakesink

For specific iMX95 hardware acceleration details and any required setup steps, I’d recommend checking the latest release notes and documentation specific to your BSP version, as hardware acceleration implementation can vary between different iMX processor families.

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Hi @adradr,

Theoretically speaking, it should use VPU acceleration since you are using the element v4l2h264enc. What issues are you facing? How are you checking the performance?
Also, which version of BSP are you using?

Hi @rudhi.tx,

Thanks, that is good to hear. I am using BSP 7.4.0.

It is not exactly an issue, the pipeline runs. I mostly wanted to check if my setup is right for using the hardware acceleration. I was using the top command to check CPU usage and the pipeline above shows about 70%, or 12% of the total CPU time.

Hi @adradr,

It should be working on BSP 7.4.0 with VPU acceleration. If you like, you can also test with different test patterns and check CPU usage under each. For example:
gst-launch-1.0 -v videotestsrc pattern=3 is-live=true ! video/x-raw,format=BGRA,width=1080,height=720,framerate=30/1 ! videoconvert ! v4l2h264enc ! h264parse ! v4l2h264dec ! fpsdisplaysink text-overlay=false video-sink=waylandsink

Hi @rudhi.tx,

Thank you for your help. The patterns produce quite different CPU usages, but I think this might be because of the video conversion. I dug a bit more into the GStreamer logs and they seem to confirm it is using hardware encoding (wave6-enc), so all good.

Hi @adradr ,

The patterns produce quite different CPU usages, but I think this might be because of the video conversion.

Exactly.