Capture video on agx xavier

i used command can get image flow from camera

gst-launch-1.0 nvv4l2camerasrc device=/dev/video0 ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, framerate=(fraction)30/1, format=(string)UYVY' ! nvvidconv ! 'video/x-raw(memory:NVMM), format=(string)NV12' ! nv3dsink -e

but how can i get mp4 video file from xavier, i follow this article but get nothing but error

hello 18502532079,

may I know what’s your camera sensor output format types.
please see-also Approaches for Validating and Testing the V4L2 Driver for testing your sensor stream.

Sure ,
here is the output format of my camera

Thanks for your qucik reply

Best regards

hello 18502532079,

let’s check with disable preview and shows frame-rate only to exclude display related issues,
for instance,
$ gst-launch-1.0 nvv4l2camerasrc device=/dev/video0 ! 'video/x-raw(memory:NVMM),format=UYVY,width=1920,height=1080,framerate=30/1 ! nvvidconv ! fpsdisplaysink text-overlay=0 name=sink_0 video-sink=fakesink sync=0 -v

I tried your command but got “<” as result
Screenshot from 2024-12-16 15-54-18

I also tried with previous fps command and it works,i get video flow from

gst-launch-1.0 v4l2src io-mode=0 device=/dev/video0 do-timestamp=true ! ‘video/x-raw, width=1920, height=1080, framerate=30/1, format=UYVY’ ! fpsdisplaysink video-sink=xvimagesink sync=false

hello 18502532079,

there’s a typo, we need to add an ' to assign correct video formats for video converter,
it should be…
$ gst-launch-1.0 nvv4l2camerasrc device=/dev/video0 ! 'video/x-raw(memory:NVMM),format=UYVY,width=1920,height=1080,framerate=30/1' ! nvvidconv ! fpsdisplaysink text-overlay=0 name=sink_0 video-sink=fakesink sync=0 -v

Hi, Jerry

It worked, i should found the typo ealier
what should we do next?

Best Regards

Now i can get live video on the screen, and i want to store it into a mp4 file
Itried command

gst-launch-1.0 nvv4l2camerasrc device=/dev/video0 ! ‘video/x-raw(memory:NVMM),format=UYVY,width=1920,height=1080,framerate=30/1’ ! nvv4l2h264enc ! h264parse ! qtmux ! filesink location=test.mp4 -e

and i get error

WARNING: erroneous pipeline: could not link nvv4l2camerasrc0 to nvv4l2h264enc0, nvv4l2h264enc0 can’t handle caps video/x-raw(memory:NVMM), format=(string)UYVY, width=(int)1920, height=(int)1080, framerate=(fraction)30/1

hello 18502532079,

it’s failure of unsupported formats.
please try convert the video format as I420 for saving to video file.
here’s sample pipeline for running preview stream and video recording.
for instance,
$ gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=150 ! 'video/x-raw, width=1920, height=1080, framerate=30/1, format=UYVY' ! tee name=streams streams. ! queue ! nvvidconv ! 'video/x-raw(memory:NVMM), format=(string)I420' ! nvv4l2h264enc ! h264parse ! qtmux ! filesink location=testUSB.mkv streams. ! queue ! xvimagesink -e

It worked。
Thanks, Chang

Best Regards!

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