Skip to content
Advertisement

How to stream 4k video in jetson xavier using udpsink in gstreamer

I am using a jetson xavier NX and i have connected 4k camera to it. I want to stream 4k video using gstreamer and RTP and store the streamed video data as an mkv file on another jetson. However my data is getting compressed a lot and I am not able to send it in 4k even though 4k is supported by the camera and by gstreamer.

SENDER
gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! "video/x-raw(memory:NVMM), width=(int)1944, height=(int)1096, format=(string)NV12" ! nvvidconv left=8 right=1928 top=8 bottom=1088 ! "video/x-raw(memory:NVMM), format=(string)NV12, width=(int)1920, height=(int)1080" ! omxh264enc qp-range=35,35:35,35:-1,-1 ! rtph264pay mtu=60000 ! udpsink clients=127.0.0.1:5000 sync=false
RECEIVER
gst-launch-1.0 udpsrc port=5000 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, sprop-parameter-sets=(string)"Z0JAKJWgHgCJ+VA\=\,aM48gA\=\=", payload=(int)96" ! rtph264depay ! h264parse !  matroskamux ! filesink location=test.mkv -e

I tried changing the resolution to 3840×2160 on the sender side but it didnt seem to work. What am i doing wrong

Advertisement

Answer

There is a maximum width of 4096 for HW encoder.

Within this limitation, you may use:

SENDER 
gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! 'video/x-raw(memory:NVMM), format=NV12, width=3840, height=2160, framerate=30/1' ! nvv4l2h264enc insert-vui=1 insert-sps-pps=1 profile=2 qp-range=35,35:35,35:-1,-1 ! h264parse ! rtph264pay config-interval=1 ! udpsink clients=127.0.0.1:5000 
RECEIVER
gst-launch-1.0 udpsrc port=5000 buffer-size=32000000 ! application/x-rtp,media=video,encoding-name=H264 ! rtpjitterbuffer latency=500 ! rtph264depay ! h264parse ! nvv4l2decoder ! nvegltransform ! nveglglessink
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement