声明:
由于版本更新,原本的 gstreamer NV 的 nvcamerasrc 插件现改为 nvarguscamerasrc
一、视频显示
指令: nvgstcapture-1.0
---------输入 mo:1 或mo:2 可以在 image 和 video之间切换
---------按 J并回车 截图,Q并回车退出。(mo:1)
---------按1并回车摄像,Q并回车退出。(mo:2)
以上产生的内容在当前路径下存储,pwd查看当前目录。
二、gstreamer 视频显示
指令:
gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)60/1 ' ! nvvidconv ! nveglglessink -e
三、gstreamer推流到本地:
udp拉流测试指令:
gst-launch-1.0 -v videotestsrc pattern=snow ! video/x-raw,width=1280,height=720 ! udpsink host=127.0.0.1 port=2222 sync=false async=false
推流指令:
gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)60/1 ' ! nvvidconv ! omxh264enc control-rate=2 bitrate=4000000 ! 'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! rtph264pay mtu=1400 ! udpsink host=127.0.0.1 port=2222 sync=false async=false
gst拉流指令:
gst-launch-1.0 udpsink port=2222 ! application/x-rtp,encoding-name=H264,payload=96 ! rtph264depay ! h264parse ! queue ! avdec_264 ! xvimagesink sync=false async=false -e
vlc拉流指令:
vlc -vv --demux h264 --h264-fps 60 udp://@127.0.0.1:2222
四、其他:
1、参考链接:NVIDIA Jetson TX2 GStreamer Pipelines | Jetson GStreamer pipelines | RidgeRun
2、vlc需要安装兼容指令的vlc才能接收到视频:
sudo apt-get build-dep vlc && sudo apt-get install libtool build-essential
wget http://download.videolan.org/pub/videolan/vlc/2.2.6/vlc-2.2.6.tar.xz
tar -xf vlc-2.2.6.tar.xz
cd vlc-2.2.6
./configure --disable-qt
make
sudo apt-get install gstreamer1.0-plugins-bad
gst-launch-1.0 nvarguscamerasrc ! nvvidconv flip-method=0 ! 'video/x-raw(memory:NVMM), width=(int)1280, height=(int)960, format=(string)NV12, framerate=(fraction)30/1' ! omxh264enc control-rate=2 bitrate=1100000 ! 'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! rtph264pay mtu=1400 ! udpsink host=127.0.0.1 port=2222 sync=false async=false
gst-launch-1.0 udpsrc port=2222 ! application/x-rtp,encoding-name=H264,payload=96 ! rtph264depay ! h264parse ! omxh264dec ! nveglglessink sync=false async=false -e
---------------------
gst-launch-1.0 nvarguscamerasrc ! nvvidconv flip-method=0 ! 'video/x-raw(memory:NVMM), width=(int)1280, height=(int)960, format=(string)NV12, framerate=(fraction)30/1' ! omxh265enc control-rate=2 bitrate=2100000 ! 'video/x-h265, stream-format=(string)byte-stream' ! h265parse ! rtph265pay mtu=9000 ! udpsink host=127.0.0.1 port=2222 sync=false async=false
gst-launch-1.0 udpsrc port=2222 ! application/x-rtp,encoding-name=H265,payload=96 ! rtph265depay ! h265parse ! queue ! omxh265dec ! nveglglessink sync=false async=false -e