Encoding CSI camera with x264enc codec

I’m testing encoding /decoding video stream from CSI camera on TX2.
I did loopback test with two command lines.

Tx:
gst-launch-1.0 nvarguscamerasrc ! ‘video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1’ ! nvv4l2h264enc ! h264parse ! rtph264pay name=pay0 pt=96 ! udpsink host=127.0.0.1 port=5000

Rx:
gst-launch-1.0 udpsrc address=127.0.0.1 port=5000 ! application/x-rtp,media=video,clock-rate=90000,encoding-name=H264,payload=96 ! rtph264depay ! nvv4l2decoder disable-dpb=true ! nv3dsink sync=false async=false window-width=960 window-height=540

It works good only if Rx command run first. Why is it?

another problem is that if codec of Tx is replaced by x264enc s/w codec as follows, the stream is delayed and trembles very much.

Tx, x264enc:
gst-launch-1.0 nvarguscamerasrc ! ‘video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1’ ! nvvidconv ! ‘video/x-raw’ ! x264enc ! h264parse ! rtph264pay name=pay0 pt=96 ! udpsink host=127.0.0.1 port=5000

Sometimes the command line makes a error.

nvidia@nvidia-desktop:~$ gst-launch-1.0 nvarguscamerasrc ! ‘video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1’ ! nvvidconv ! ‘video/x-raw’ ! x264enc ! h264parse ! rtph264pay name=pay0 pt=96 ! udpsink host=127.0.0.1 port=5000
Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
Setting pipeline to PLAYING …
New clock: GstSystemClock
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:736 Failed to create CaptureSession
Redistribute latency…
Got EOS from element “pipeline0”.
Execution ended after 0:00:00.009788748
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …

How to resolve these problems?

Hi,
Please set the two properties insert-sps-pps=1 idrinterval=15 and try again. Here is a post for reference:
Gstreamer TCPserversink 2-3 seconds latency - #5 by DaneLLL

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