安裝必須套件
$ sudo apt-get install libgstrtspserver-1.0 libgstreamer1.0-dev
編譯
$ gcc test-launch.c -o test-launch $(pkg-config --cflags --libs gstreamer-1.0 gstreamer-rtsp-server-1.0)
若出現
undefined reference to `gst_rtsp_media_factory_set_enable_rtcp'
編譯失敗,刪除相關程式碼即可
測試啟動 service
$ ./test-launch "videotestsrc ! omxh265enc ! rtph265pay name=pay0 pt=96"
開啟畫面 (Jetson 平台)
$ gst-launch-1.0 rtspsrc location=rtsp://127.0.0.1:8554/test ! application/x-rtp, media=video ! queue ! decodebin ! nvvidconv ! nveglglessink
開啟畫面 (一般平台)
$ gst-launch-1.0 rtspsrc location=rtsp://192.168.0.105:8554/test ! application/x-rtp, media=video ! queue ! decodebin ! nvvideoconvert ! nveglglessink
使用 CSI 攝影機
$ ./test-launch "nvarguscamerasrc ! \
video/x-raw(memory:NVMM), format=NV12, width=640, height=480, framerate=30/1 ! \
nvvidconv ! video/x-raw ! omxh265enc ! rtph265pay name=pay0 pt=96 config-interval=1"
$ ./test-launch "nvarguscamerasrc ! \
video/x-raw(memory:NVMM), format=NV12, width=640, height=480, framerate=30/1 ! \
nvvidconv ! video/x-raw ! omxh265enc ! rtph265pay name=pay0 pt=96 config-interval=1"
沒有留言:
張貼留言