Thanks for your response.
Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.
Did you like my answer?

Based on the error messages you’re seeing, this appears to be a known issue with the vpuenc_h264 element on certain BSP versions and configurations. The error “Could not initialize supporting library” indicates that the VPU hardware encoder is having trouble initializing(1).
There are a few approaches to try:
1. Use v4l2h264enc instead of vpuenc_h264
For BSP 7 and some configurations, the recommended approach is to use v4l2h264enc instead of vpuenc_h264(1). Try this pipeline:
gst-launch-1.0 videotestsrc ! videoconvert ! v4l2h264enc ! fakesink
2. Check for device conflicts
Since you mentioned /dev/video0 is busy, there might be another process using the video device. Check what’s using it:
lsof /dev/video*
3. Try alternative pipeline configurations
Based on the official documentation, you can also try these encoding pipelines(2):
gst-launch-1.0 videotestsrc num-buffers=300 ! video/x-raw, width=1920, height=1080, framerate=60/1 ! videoconvert ! vpuenc_h264 ! video/x-h264 ! h264parse ! qtmux ! filesink location=videotestsrc.mp4
Or use the encodebin element which automatically creates an encoding pipeline(2):
gst-launch-1.0 videotestsrc num-buffers=300 ! video/x-raw, width=1920, height=1080, framerate=60/1 ! encodebin ! filesink location=videotestsrc.mp4
4. Debug the VPU initialization
You can get more debugging information by setting the GST_DEBUG environment variable(2):
export GST_DEBUG=2
5. Verify VPU availability
Check if the VPU-related GStreamer elements are properly installed and available:
gst-inspect-1.0 | grep vpu
gst-inspect-1.0 | grep h264enc
This issue appears to be related to the VPU driver initialization problems that have been reported on various BSP versions(1). The community discussion indicates that switching to v4l2h264enc often resolves these initialization issues.