I am trying to record camera data without any data loss using nvidia hardware-accelerated gstreamer. However, I have encountered some issues.
The developement environments are as below.
- NVIDIA Jetson AGX Orin Developer Kit
- Linux ubuntu 5.10.104-tegra, aarch64 aarch64 aarch64 GNU/Linux
-
R35 (release), REVISION: 3.1
Question 1.
As I known, for lossless data recording, using YUV4:4:4 format is necessary, because the h264 codec only supports it. Therefore, I recorded and loaded without any data loss with pipelines shown below.
(Record)
appsrc ! video/x-raw, framerate=30/1, width=1280, height=720, format=Y444 ! videoconvert ! x264enc key-int-max=30 bitrate=65536 pass=qual quantizer=0 speed-preset=ultrafast tune=zerolatency ! filesink location=/mnt/recorded.h264
(Load)
filesrc location=/mnt/recorded.h264 ! video/x-h264 ! h264parse ! avdec_h264 ! video/x-raw, framerate=30/1, width=1280, height=720, format=Y444 ! appsink emit-signals=true
However, I failed to do it with hardware-acceleration pipeline elements. The pipelines that I have tried are:
(Record)
appsrc ! video/x-raw, framerate=30/1, width=1280, height=720, format=NV24 ! videoconvert ! nvvidconv ! video/x-raw(memory:NVMM) ! nvv4l2h264enc bitrate=67108864 enable-lossless=true maxperf-enable=true ! filesink location=/mnt/recorded.h264
(Load)
filesrc location=/mnt/recorded.h264 ! video/x-h264 ! h264parse ! nvv4l2decoder enable-max-performance=true ! video/x-raw(memory:NVMM) ! nvvidconv ! videoconvert ! video/x-raw, framerate=30/1, width=1280, height=720, format=NV24 ! appsink emit-signals=true
When running it, data recording can be done without error messages. I could get somehow large-sized h264 file after recording. (but not sure if the recorded data has no problem, because it is not video container file). Afterwards, when I try loading the recorded data, I got error messages like:
nvbufsurftransform: Could not get EGL display connection
sh: 1: lsmod: not found
sh: 1: modprobe: not found
nvbuf_utils: Could not get EGL display connection
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261
NVMEDIA: NvMMLiteNVMEDIAProcessVES: 1824: NvMediaParserParse Unsupported Codec
Stream format not found, dropping the frame
Stream format not found, dropping the frame
NVMEDIA: NvMMLiteNVMEDIADecDoWork: 2228: NVMEDIA Video Dec Unsupported Stream
NVMEDIA: NvMMLiteNVMEDIAProcessVES: 1824: NvMediaParserParse Unsupported Codec
NVMEDIA: NvMMLiteNVMEDIAProcessVES: 1824: NvMediaParserParse Unsupported Codec
terminate called after throwing an instance of ‘std::runtime_error’
what(): error from: nvv4l2decoder0: No valid frames decoded before end of stream(gstvideodecoder.c(1140): gst_video_decoder_sink_event_default (): /GstPipeline:pipeline0/nvv4l2decoder:nvv4l2decoder0:
no valid frames found)
Could anyone help me to resolve it?