Gstreamer Nvv4l2h264enc: Cannot identify device '/dev/v4l2-nvenc'

Hi, i use the Jetson Orin AGX board that emulated to jetson-agx-orin-devkit-as-nano4gb. So i’d like to test encode and decode h264 with gstreamer and usb camera.
My pipelines: gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw, width=1920, height=1080, format=YUY2, framerate=5/1 ! nvvidconv ! nvv4l2h264enc ! h264parse ! avimux ! filesink location=video.mp4.

However, some problem occurred:
Setting pipeline to PAUSED …
ERROR: Pipeline doesn’t want to pause.
ERROR: from element /GstPipeline:pipeline0/nvv4l2h264enc:nvv4l2h264enc0: Cannot identify device ‘/dev/v4l2-nvenc’.
Additional debug info:
/dvs/git/dirty/git-master_linux/3rdparty/gst/gst-v4l2/gst-v4l2/v4l2_calls.c(637): gst_v4l2_open (): /GstPipeline:pipeline0/nvv4l2h264enc:nvv4l2h264enc0:
system error: No such file or directory
Setting pipeline to NULL …
Freeing pipeline …
////
Please help me resolve it. Thanks

Hi,
This is expected since there is no hardware encoder in Orin Nano. Please refer to module data sheet for supported hardware functions:
https://developer.nvidia.com/downloads/assetsembeddedsecurejetsonorinnanodocsjetsonorinnanods-11105-001v02pdf

Can I have any way to encode h264 by gstreamer with this board?
I’d like to have more encoding way. Like using cuda, chip encode, cpu, gpu.
Thanks

Hi,
Please try software encoder x264enc:

$ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw, width=1920, height=1080, format=YUY2, framerate=5/1 ! videoconvert ! x264enc ! h264parse ! matroskamux ! filesink location=video.mkv

Actually, I’d like to know the encoding ability of this board.
but when I encode 1920x1080 5fps (using your pipeline), the average of CPU usage increases by up to 30-40%.
Is the amount of number right?
When I reviewed the specification of Jetson Orin Nano 4GB, I saw “1080p30 supported by 1-2 CPU cores” and thought that Jetson Orin Nano 4Gb can encode two stream cameras from YUY2 to h264 (1080p30) with 2 CPU cores and with the low usage of CPU (Not 30%).
Can you explain to me about that?
Thanks.

Hi,
If you need encoding function in your use-case, we would suggest use Orin or Orin NX to utilize hardware encoder.

I want to encode without a hardware encoder. Like Orin Nano, the video encoder is just supported by the software. Is there any way to do that? If using your pipelines, I think It’s not suitable for the specification “1080p30 supported by 1-2 CPU cores” because of the high CPU usage for that.
Moreover, I think Orin nano could encode 1920x1080 30fps with low CPU usage.
Thanks

Hi,
Do you check CPU usage through tegrastats? If not, please run sudo jetson_clocks to enable CPU cores t maximum clock. And check CPU usage by running sudo tegrastats.

Yes. I checked multiple tools: sudo tegrastats, top, htop, jtop,… It showed the average of CPUs (usage): ~30% when Orin Nano encodes from camera YUYV2 to h264 files.

Hi,
Please break down the pipeline and check tegrastats. To identify how much usage is used in x264enc. You may try the pipelines:

$ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw, width=1920, height=1080, format=YUY2, framerate=5/1 ! videoconvert ! video/x-raw,format=I420 ! fakesink
$ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw, width=1920, height=1080, format=YUY2, framerate=5/1 ! videoconvert ! video/x-raw,format=I420 ! x264enc ! fakesink
$ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw, width=1920, height=1080, format=YUY2, framerate=5/1 ! videoconvert ! video/x-raw,format=I420 ! x264enc speed-preset="ultrafast" ! fakesink

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.