Xavier R31.1 nvv4l2h264enc Problem

gst-launch-1.0 videotestsrc ! videoconvert ! nvv4l2h264enc ! matroskamux ! filesink location=x1.mkv
WARNING: erroneous pipeline: could not link videoconvert0 to nvv4l2h264enc0

I dont understand why cant I use nvv4l2h264enc, any ideas?

Hi osmanberkx0x,

I think your pipeline is missing a H.264 parser and nvvidconv element, you can try this one:

gst-launch-1.0 videotestsrc ! "video/x-raw" ! nvvidconv ! "video/x-raw(memory:NVMM)" ! nvv4l2h264enc ! h264parse ! matroskamux ! filesink location=x1.mkv

Basically the issue with the original pipeline you posted is that the capabilities (“caps”) of videoconvert0 are not compatible with nvv4l2h264enc0. You can check the caps of each element by running the following command:

gst-inspect-1.0 nvv4l2h264enc

More info about how to use this accelerated GStreamer elements can be found here: https://developer.download.nvidia.com/embedded/L4T/r31_Release_v1.0/Docs/Accelerated_GStreamer_User_Guide.pdf?1lG8H2_QIaf7May7L11QV7jVX2WSsvPU6thHnargvncoCA3BTHpKdiJKtE-wK6jbr6Mgsf9M9-gU_dR3STQsPYeO6nm6xfWYAR1lneC6PIvO4jm6qPsoPCWC3KukCqhQ0G_elV-qRGxhtP5Wou8jjykWWD6_J7j61gl0ky0RhZqt_JF-m90



Thank you very much, the problem is solved.

I have a question though, before when I used omxh264enc there was no need for using h264parse.

What does h264parse really do, I thought it was parsing compressed h264 packages before omxh264dec, so I was using h264parse+omxh264dec.

And if you have time I have another question, I see that in your website you have encoding, decoding tests, and you share cpu, gpu usages. I can’t see the gpu usage while doing gpu encoding or gpu decoding with tegrastats or other programs. And when I play a video I can see gpu usage with tegra stats or etc.

How do you see gpu usage while doing encoding/decoding?

Hi osmanberkx0x,

Regarding your questions:

  1. The h264parse element provides the format of the H.264 stream to the encoder. Also in H.264 there are different profiles (“formats”) and this element can be used to convert between these “formats” because not all are supported by the hardware encoders/decoders in the Xavier.

  2. I understand that gst-omx and gst-v4l2 elements use specific hardware accelerators but not the GPU.

While omxh264enc does not need h264 parse, nvv4l2h264parse needs it.

Does this mean anything, does omxh264enc handle parsing itself? And what is the cause of this?

h264parse converts stream-format: byte-stream to avc. We have certain code to do this in omxh264enc but decide to leverage 3rdparty element h264parse in new implemented nvv4l2h264enc.