dusty-nv / jetson-utils

C++/CUDA/Python multimedia utilities for NVIDIA Jetson
MIT License
739 stars 289 forks source link

Missing `/dev/v4l2-nvenc` on Jetson Orin Nano #197

Open JanGerber opened 9 months ago

JanGerber commented 9 months ago

I'm trying to use the WebRTC output but I'm getting the following errro:

[gstreamer] gstEncoder -- failed to set pipeline state to PLAYING (error 0)
[gstreamer] gstEncoder -- starting pipeline, transitioning to GST_STATE_PLAYING
[gstreamer] GST_LEVEL_WARNING nvv4l2h264enc v4l2
              /dvs/git/dirty/git-master_linux/3rdparty/gst/gst-v4l2/gst-v4l2/v4l2_calls.c:637  gst_v4l2_open
              error: Cannot identify device '/dev/v4l2-nvenc'.
[gstreamer] GST_LEVEL_WARNING nvv4l2h264enc v4l2
              /dvs/git/dirty/git-master_linux/3rdparty/gst/gst-v4l2/gst-v4l2/v4l2_calls.c:637  gst_v4l2_open
              error: system error: No such file or directory
[gstreamer] GST_LEVEL_WARNING nvv4l2h264enc videoencoder
              gstvideoencoder.c:1636  gst_video_encoder_change_state
              error: Failed to open encoder

My code looks like that:

output = videoOutput::Create("webrtc://@:8554/my_output");
  uchar3* img = NULL;
  cudaAllocMapped(&img, pImage->getWidth(), pImage->getHeight());
  if( CUDA_FAILED(cudaMemcpy(img, pImage->getBuffer(), pImage->getSizeInBytes(), cudaMemcpyDeviceToDevice)) )
  {
    EULER_LOG_ERROR(m_log, "memcpy error");

  }else{
    output->Render(img, pImage->getWidth(), pImage->getHeight(), IMAGE_RGB8);
  } // memcpy error

  CUDA(cudaDeviceSynchronize());
  CUDA(cudaFreeHost(img));

How can I use the output render with an Jetson Orin Nano?