一:Gstreamer
下载gstreamer 编译等自行百度
pipeline命令-硬编码输出rtp
gst-launch-1.0 -e videotestsrc ! "video/x-raw,format=I420,width=320,height=240,framerate=30/1" ! droidvenc ! "video/x-h264,stream-format=avc,alignment=au,width=320,height=240,framerate=30/1" ! h264parse ! "video/x-h264, stream-format=byte-stream" ! avmux_mpegts ! "video/mpegts,systemstream=true" ! rtpmp2tpay ! udpsink name=sink host=172.16.23.27 port=7236
pipeline命令-软编码输出rtp
gst-launch-1.0 -e videotestsrc ! "video/x-raw,format=I420,width=320,height=240,framerate=30/1" ! queue ! avenc_mpeg2video ! "width=320,height=240,framerate=30/1" ! mpegvideoparse ! mux. audiotestsrc ! avenc_aac ! queue ! mux. avmux_mpegts name=mux ! "video/mpegts,systemstream=true" ! rtpmp2tpay ! udpsink name=sink host=172.16.23.27 port=7236
这里仅作参考,pipeline各组件搭配根据自己需求来
二:VLC
下载VLC客户端
选择 媒体->打开网络串流
URL输入如图所示你的rtp的ip及端口号即可
注意: 如果都在同一个设备上应该不会出现问题,但是如果多个设备间进行rtp通信可能会出现打不开的问题,我这里是公司9863手机做推流,解决如下:
- 命令行 iptables -P INPUT ACCEPT
- 命令行 iptables -P OUTPUT ACCEPT
- 连接上wifi并认证,直到能ping通目标设备即可,我这里是连接的电脑ip为172.16.23.27端口为7236
以上仅是为了能正常ping通目标设备,这是我们公司设备的方法,如果能ping同无需
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)