我在 Ubuntu 中使用以下管道流式传输 mp3,它运行良好。
发件人:
gst-launch filesrc location=/home/file.mp3 ! mad ! audioconvert ! audio/x-raw-int,channels=1,depth=16,width=16, rate=44100 ! rtpL16pay ! udpsink host=192.168.1.103 port=5000
接收者:
gst-launch udpsrc port=5000 caps="application/x-rtp, media=(string)audio, clock-rate=(int)44100, width=(int)16, height=(int)16, encoding-name=(string)L16, encoding-params=(string)1, channels=(int)1, channel-position=(int)1, payload=(int)96" ! gstrtpjitterbuffer do-lost=true ! rtpL16depay ! audioconvert ! alsasink sync=false
但是当我在 Windows 中使用它时它不起作用。我能听到它只在一开始播放,但只播放了很短的时间。目的地接收媒体,但我听不到声音。这是使用的管道,
发件人:
gst-launch -v filesrc location=C:/file.mp3 ! mad ! audioconvert ! audio/x-raw-int,channels=1,depth=16,width=16, rate=44100 ! rtpL16pay ! udpsink host=192.168.1.105 port=5000
接收者:
gst-launch -v udpsrc port=5000 caps="application/x-rtp, media=(string)audio, clock-rate=(int)44100, encoding-name=(string)L16, encoding-params=(string)1, channels=(int)1, payload=(int)96" ! gstrtpjitterbuffer do-lost=true ! rtpL16depay ! audioconvert ! autoaudiosink sync=false
Gstreamer OSSBUILD用于 Windows。请帮我解决这个问题。
如果需要,以下是终端上的输出,
发件人:
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstMad:mad0.GstPad:src: caps = audio/x-raw-int, endiannes
s=(int)1234, signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)44100
, channels=(int)2
/GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:src: caps = audio/x-
raw-int, endianness=(int)4321, signed=(boolean)true, width=(int)16, depth=(int)1
6, rate=(int)44100, channels=(int)1
/GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:sink: caps = audio/x
-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)32, depth=(int)
32, rate=(int)44100, channels=(int)2
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = audio/x-raw-
int, endianness=(int)4321, signed=(boolean)true, width=(int)16, depth=(int)16, r
ate=(int)44100, channels=(int)1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = audio/x-raw
-int, endianness=(int)4321, signed=(boolean)true, width=(int)16, depth=(int)16,
rate=(int)44100, channels=(int)1
/GstPipeline:pipeline0/GstRtpL16Pay:rtpl16pay0.GstPad:src: caps = application/x-
rtp, media=(string)audio, clock-rate=(int)44100, encoding-name=(string)L16, enco
ding-params=(string)1, channels=(int)1, payload=(int)96, ssrc=(uint)1331970475,
clock-base=(uint)3177922110, seqnum-base=(uint)10029
/GstPipeline:pipeline0/GstRtpL16Pay:rtpl16pay0.GstPad:sink: caps = audio/x-raw-i
nt, endianness=(int)4321, signed=(boolean)true, width=(int)16, depth=(int)16, ra
te=(int)44100, channels=(int)1
/GstPipeline:pipeline0/GstRtpL16Pay:rtpl16pay0: timestamp = 3177922110
/GstPipeline:pipeline0/GstRtpL16Pay:rtpl16pay0: seqnum = 10029
/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = application/x-rtp
, media=(string)audio, clock-rate=(int)44100, encoding-name=(string)L16, encodin
g-params=(string)1, channels=(int)1, payload=(int)96, ssrc=(uint)1331970475, clo
ck-base=(uint)3177922110, seqnum-base=(uint)10029
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 40987345000 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = NULL
/GstPipeline:pipeline0/GstRtpL16Pay:rtpl16pay0.GstPad:sink: caps = NULL
/GstPipeline:pipeline0/GstRtpL16Pay:rtpl16pay0.GstPad:src: caps = NULL
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = NULL
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = NULL
/GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:src: caps = NULL
/GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:sink: caps = NULL
/GstPipeline:pipeline0/GstMad:mad0.GstPad:src: caps = NULL
Setting pipeline to NULL ...
Freeing pipeline ...
接收者:
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstRtpJitterBuffer:rtpjitterbuffer0.GstPad:src: caps = ap
plication/x-rtp, media=(string)audio, clock-rate=(int)44100, encoding-name=(stri
ng)L16, encoding-params=(string)1, channels=(int)1, payload=(int)96
/GstPipeline:pipeline0/GstRtpJitterBuffer:rtpjitterbuffer0.GstPad:sink: caps = a
pplication/x-rtp, media=(string)audio, clock-rate=(int)44100, encoding-name=(str
ing)L16, encoding-params=(string)1, channels=(int)1, payload=(int)96
/GstPipeline:pipeline0/GstRtpL16Depay:rtpl16depay0.GstPad:src: caps = audio/x-ra
w-int, endianness=(int)4321, signed=(boolean)true, width=(int)16, depth=(int)16,
rate=(int)44100, channels=(int)1, channel-positions=(GstAudioChannelPosition)<
GST_AUDIO_CHANNEL_POSITION_FRONT_MONO >
/GstPipeline:pipeline0/GstRtpL16Depay:rtpl16depay0.GstPad:sink: caps = applicati
on/x-rtp, media=(string)audio, clock-rate=(int)44100, encoding-name=(string)L16,
encoding-params=(string)1, channels=(int)1, payload=(int)96
/GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:src: caps = audio/x-
raw-int, width=(int)16, depth=(int)16, endianness=(int)1234, signed=(boolean)tru
e, channels=(int)1, rate=(int)44100, channel-positions=(GstAudioChannelPosition)
< GST_AUDIO_CHANNEL_POSITION_FRONT_MONO >
/GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:sink: caps = audio/x
-raw-int, endianness=(int)4321, signed=(boolean)true, width=(int)16, depth=(int)
16, rate=(int)44100, channels=(int)1, channel-positions=(GstAudioChannelPosition
)< GST_AUDIO_CHANNEL_POSITION_FRONT_MONO >
/GstPipeline:pipeline0/GstAutoAudioSink:autoaudiosink0/GstWaveFormSink:autoaudio
sink0-actual-sink-waveform.GstPad:sink: caps = audio/x-raw-int, width=(int)16, d
epth=(int)16, endianness=(int)1234, signed=(boolean)true, channels=(int)1, rate=
(int)44100, channel-positions=(GstAudioChannelPosition)< GST_AUDIO_CHANNEL_POSIT
ION_FRONT_MONO >
/GstPipeline:pipeline0/GstAutoAudioSink:autoaudiosink0.GstGhostPad:sink: caps =
audio/x-raw-int, width=(int)16, depth=(int)16, endianness=(int)1234, signed=(boo
lean)true, channels=(int)1, rate=(int)44100, channel-positions=(GstAudioChannelP
osition)< GST_AUDIO_CHANNEL_POSITION_FRONT_MONO >
/GstPipeline:pipeline0/GstAutoAudioSink:autoaudiosink0.GstGhostPad:sink.GstProxy
Pad:proxypad0: caps = audio/x-raw-int, width=(int)16, depth=(int)16, endianness=
(int)1234, signed=(boolean)true, channels=(int)1, rate=(int)44100, channel-posit
ions=(GstAudioChannelPosition)< GST_AUDIO_CHANNEL_POSITION_FRONT_MONO >