How to view CSI sensor stream. Source:

gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM),width=1024, height=768, framerate=120/1, format=NV12' ! nvvidconv flip-method=0 ! nvegltransform ! nveglglessink -e

How to extend Xavier's display and mouse/keyboard over the network to another linux device

Terminal N1

ssh -X name@hostip 
export DISPLAY=:0

Terminal N2

ssh -X name@hostip 'x2x -east -to :0'

Cloning a filesystem of a Jetson and making a deployment image of it to distribute it to other devices

Stop the filesystem and force it to read only access:

 echo u > /proc/sysrq-trigger

CASE I: Transferring the image over ssh to host PC:

dd if=/dev/mmcblk0p1 | ssh user@hostpc dd of=/data/image.raw 

Transferring the image over ssh from host PC to Jetson:

ssh user@server dd if=/data/image.raw | dd of=/dev/mmcblk0p1 status=progress

CASE II: Transferring the image over netcat to host PC: Host PC

netcat -l -p <port> > your_image_file


 sudo dd if=/dev/mmcblk0p1 | netcat <ip_address> <port>

CASE III: preparation of distribution image

cd /home/nvidia/Downloads/Xavier/Linux_for_Tegra/bootloader/ && sudo ./mksparse -v --fillpattern=0 /data/image.raw system.img

and deployment of an image to another device via usb cable

cd /home/nvidia/Downloads/Xavier/Linux_for_Tegra/  && sudo ./ -r jetson-xavier mmcblk0p1

Adding web chat feature for onboard camera

sudo su
cd /usr/src/linux-headers-4.9.140-tegra-ubuntu18.04_aarch64/kernel-4.9
## dropped in latter release##make modules_prepare
mkdir v4l2loopback
git clone v4l2loopback
cd v4l2loopback
## if the sequence above fails - adopt the line: make -C /lib/modules/4.9.140-tegra/build M=`$pwd` modules
## make -C /lib/modules/`uname -r`-tegra/build M=/usr/src/v4l2loopback modules_install

make install
apt-get install -y v4l2loopback-dkms v4l2loopback-utils
modprobe v4l2loopback devices=1 video_nr=2 exclusive_caps=1
echo options v4l2loopback devices=1 video_nr=2 exclusive_caps=1 > /etc/modprobe.d/v4l2loopback.conf
echo v4l2loopback > /etc/modules
update-initramfs -u


gst-launch-1.0 -v nvarguscamerasrc ! 'video/x-raw(memory:NVMM), format=NV12, width=1920, height=1080, framerate=30/1' ! nvvidconv ! 'video/x-raw, width=640, height=480, format=I420, framerate=30/1' ! videoconvert ! identity drop-allocation=1 ! 'video/x-raw, width=640, height=480, format=RGB, framerate=30/1' ! v4l2sink device=/dev/video2


export DISPLAY=:0

Otherwise, you may check that the output is played either with A:

 vlc v4l2:///dev/video2

or B:

gst-launch-1.0 v4l2src device=/dev/video2 ! 'video/x-raw, format=RGB, width=640, height=480, framerate=30/1' ! queue ! videoconvert ! xvimagesink

Network streaming for onboard CSI and ZED cameras

CSI camera streaming:

sudo apt-get install libgstrtspserver-1.0 libgstreamer1.0-dev
tar -xvf gst-rtsp-server-1.14.1.tar.xz
cd  gst-rtsp-server-1.14.1
cd examples
gcc test-launch.c -o test-launch $(pkg-config --cflags --libs gstreamer-1.0 gstreamer-rtsp-server-1.0)
./test-launch "nvarguscamerasrc ! video/x-raw(memory:NVMM), format=NV12, width=1920, height=1080, framerate=30/1 ! nvvidconv ! video/x-raw, width=640, height=480, format=NV12, framerate=30/1 ! omxh265enc ! rtph265pay name=pay0 pt=96 config-interval=1"

Another computer in the network:

gst-launch-1.0 rtspsrc location=rtsp:// ! queue ! decodebin ! videoconvert ! xvimagesink


gst-launch-1.0 rtspsrc location=rtsp:// ! queue ! decodebin ! videoconvert ! v4l2sink device=/dev/video1

ZED camera streaming:

./test-launch "v4l2src device=/dev/video1 ! video/x-raw,format=YUY2 ! nvvidconv ! video/x-raw(memory:NVMM),width=2560,height=720,format=I420 ! omxh265enc ! rtph265pay name=pay0 pt=96"

Vlc reading

vlc rtsp://server_ip_address:8554/test

Recording an event with onboard CSI camera

Video only:

gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=2592, height=1944, format=NV12, framerate=30/1' ! omxh264enc ! 'video/x-h264,stream-format=byte-stream' ! filesink location="test2.h264" -e

With audio:

gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM),width=1920, height=1080,format=NV12,framerate=30/1' ! omxh264enc ! 'video/x-h264,stream-format=byte-stream' ! h264parse ! queue ! muxer.video_0 alsasrc device="hw:2,0" ! voaacenc ! queue ! muxer.audio_0 qtmux name=muxer ! filesink

Make a single shoot

gst-launch-1.0 nvarguscamerasrc num-buffers=1 ! 'video/x-raw(memory:NVMM), width=(int)2592, height=(int)1944' ! nvvidconv ! jpegenc ! filesink location=camerashot.jpg