通过 Gstreamer 的视频流
Video streaming via Gstreamer
我尝试在我的 Windows OS 计算机上使用服务器上的命令检查视频 rtp 流:
gst-launch-1.0 filesrc location = d:/TestVideos/lama.mp4 ! qtdemux ! video/x-h264 ! rtph264pay ! udpsink host=192.168.1.162 port=6001
然后我尝试捕捉流:
gst-launch-1.0 -v udpsrc port=6001 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! decodebin ! videoconvert ! autovideosink
我在控制台看到这样一张图:
仅此而已。视频结束服务器window自动关闭
但如果尝试使用 testvideosrc,一切正常。
服务器端:
gst-launch-1.0 -v videotestsrc ! video/x-raw, framerate=20/1 ! videoscale ! videoconvert ! x264enc tune=zerolatency bitrate=500 speed-preset=superfast ! rtph264pay ! udpsink host=192.168.1.162 port=6001
客户端:
gst-launch-1.0 -v udpsrc port=6001 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! decodebin ! videoconvert ! autovideosink
不幸的是我找不到错误...如果有人帮忙找到它就太好了。谢谢。
也试试这个:
gst-launch-1.0 filesrc location = d:/TestVideos/lama.mp4 ! qtdemux ! video/x-h264 ! h264parse !rtph264pay ! udpsink host=192.168.1.162 port=6001
在接收方
gst-launch-1.0 -v udpsrc port=6001 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! h264parse ! avdec_h264 ! autovideosink
下面是我在单板机-Freescale imx6上的命令(供参考)
gst-launch-1.0 –gst-debug=0 imxv4l2videosrc device=/dev/video1 fps-n=30 capture-mode=4 ! imxvpuenc_h264 bitrate=1000
! h264parse ! rtph264pay ! udpsink host=192.168.11.11 port=5001
gst-launch-1.0 –gst-debug=0 udpsrc port=5001 ! $CAPS ! rtph264depay ! h264parse ! avdec_h264 !
autovideosink sync=true
我尝试在我的 Windows OS 计算机上使用服务器上的命令检查视频 rtp 流:
gst-launch-1.0 filesrc location = d:/TestVideos/lama.mp4 ! qtdemux ! video/x-h264 ! rtph264pay ! udpsink host=192.168.1.162 port=6001
然后我尝试捕捉流:
gst-launch-1.0 -v udpsrc port=6001 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! decodebin ! videoconvert ! autovideosink
我在控制台看到这样一张图:
仅此而已。视频结束服务器window自动关闭
但如果尝试使用 testvideosrc,一切正常。
服务器端:
gst-launch-1.0 -v videotestsrc ! video/x-raw, framerate=20/1 ! videoscale ! videoconvert ! x264enc tune=zerolatency bitrate=500 speed-preset=superfast ! rtph264pay ! udpsink host=192.168.1.162 port=6001
客户端:
gst-launch-1.0 -v udpsrc port=6001 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! decodebin ! videoconvert ! autovideosink
不幸的是我找不到错误...如果有人帮忙找到它就太好了。谢谢。
也试试这个:
gst-launch-1.0 filesrc location = d:/TestVideos/lama.mp4 ! qtdemux ! video/x-h264 ! h264parse !rtph264pay ! udpsink host=192.168.1.162 port=6001
在接收方
gst-launch-1.0 -v udpsrc port=6001 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! h264parse ! avdec_h264 ! autovideosink
下面是我在单板机-Freescale imx6上的命令(供参考)
gst-launch-1.0 –gst-debug=0 imxv4l2videosrc device=/dev/video1 fps-n=30 capture-mode=4 ! imxvpuenc_h264 bitrate=1000
! h264parse ! rtph264pay ! udpsink host=192.168.11.11 port=5001
gst-launch-1.0 –gst-debug=0 udpsrc port=5001 ! $CAPS ! rtph264depay ! h264parse ! avdec_h264 !
autovideosink sync=true