0

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 3840x2160 on the sender side but it didnt seem to work. What am i doing wrong

Akshay Acharya
  • 253
  • 4
  • 13

1 Answers1

2

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
SeB
  • 1,159
  • 6
  • 17
  • Thank you I am able ot stream 4k video with this locally. If I want to store the video as an mkv on a non jetson server, what modifications do i have to make to the receiver – Akshay Acharya Nov 25 '21 at 03:46
  • You may try: gst-launch-1.0 udpsrc port=5000 buffer-size=32000000 ! application/x-rtp,media=video,encoding-name=H264 ! rtpjitterbuffer latency=500 ! rtph264depay ! h264parse ! matroskamux ! filesink location=test.mkv – SeB Nov 26 '21 at 08:45
  • thank you it works. Can you also tell me how to store it as mp4 formats or other formats? mkv seems to be too heavy to transfer over the network. Which foramt would be light but still maintain good quality over the streaming? – Akshay Acharya Dec 17 '21 at 02:43
  • First, please set this topic as answered as the initial question is answered. Also consider my answer to another question from you. For your case, it should be enough to replace matroskamux by mp4mux or better qtmux and save file with mp4 extension. – SeB Dec 21 '21 at 21:57