我有一个pcm音频文件,我想通过rtp流式传输。当我做的时候
gst-launch-1.0 filesrc location=AudioRaw515151.pcm ! audio/x-raw, format=S16LE, channels=1, layout=interleaved, rate=8000 ! alawenc ! rtppcmapay ! udpsink host=192.168.2.5 port=5010
我有那种消息
Pipeline is PREROLLING ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 0:00:00.019270487
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
但是我可以播放这个音频,这意味着音频还可以。
gst-launch-1.0 filesrc location=AudioRaw515151.pcm ! audio/x-raw, format=S16LE, channels=1, layout=interleaved, rate=8000 ! alawenc ! rtppcmapay ! rtppcmdepay ! alawdec ! audiosink
我尝试使用另一个文件avi文件,从中获取音频并制作相同的内容
gst-launch-1.0 filesrc location=file.avi ^
! qtdemux name=mux^
! queue ^
! faad ^
! audioconvert ^
! audioresample ^
! "audio/x-raw, layout=(string)interleaved, rate=(int)8000" ^
! alawenc ^
! rtppcmapay ^
! queue ^
! udpsink host=192.168.2.5 port=5010
如你所见,这同样的事情,但来自avi的音频。一切正常。
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
当我打开Wireshark时,我看到当我使用PCM运行我的管道时,它会毫无延迟地触发所有数据,并且我发送的每个数据包都是:
Header checksum: 0x0000 [incorrect, should be 0x40b5 (may be caused by "IP checksum offload"?)]
Message: Bad checksum
所以这是一个问题。我认为我的时间戳或类似的问题,当我这样做时!alawenc(编码为G711),我是对的? 什么解决方案可以解决这个问题?
答案 0 :(得分:1)
第一个问题。第二个例子是否播放?
还有一些评论:
最后在git repo中有一堆rtp示例: https://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/tests/examples/rtp/client-PCMA.sh