我正在尝试使用 模拟发送和接收 mpeg 视频gst-launch-1.0
。
发件人管道:
gst-launch-1.0 videotestsrc ! video/x-raw,width=1920,height=1080,framerate=15/1 ! queue ! x264enc bitrate=4000 ! queue ! mpegtsmux ! rtpmp2tpay ! udpsink host=224.10.10.10 port=15004
接收器管道:
gst-launch-1.0 -v rtpbin name=rtpbin udpsrc caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)MP2T,payload=(int)33,seqnum-offset=(uint)2803,timestamp-offset=(uint)2170591411, ssrc=(uint)2276926567" port=15004 multicast-group=224.10.10.10 ! rtpbin.recv_rtp_sink_0 rtpbin. ! rtpmp2tdepay ! tsdemux ! h264parse ! capsfilter caps=video/x-h264,alignment=au,stream-format=avc ! avdec_h264 ! fpsdisplaysink sync=1 udpsrc port=18889 ! rtpbin.recv_rtcp_sink_0
扣除:
gst-launch-1.0 -v rtpbin name=rtpbin udpsrc caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)MP2T,payload=(int)33,seqnum-offset=(uint)2803,timestamp-offset=(uint)2170591411, ssrc=(uint)2276926567" port=15004 multicast-group=224.10.10.10 ! rtpbin.recv_rtp_sink_0 rtpbin. ! rtpmp2tdepay ! tsdemux ! decodebin ! fpsdisplaysink sync=1 udpsrc port=18889 ! rtpbin.recv_rtcp_sink_0
首先运行接收器,然后发送器立即按预期显示视频窗口。
但是当发送方首先启动时,接收方管道会挂起大约 10 秒,显示大量这些消息:
0:00:01.654820616 23285 0x56008c3bb640 WARN h264parse gsth264parse.c:1349:gst_h264_parse_handle_frame:<h264parse0> broken/invalid nal Type: 1 Slice, Size: 32773 will be dropped
gst-launch-1.0 --gst-version
返回:
GStreamer Core Library version 1.16.2