Using GStreamer to Convert WAV -> RTP Results in Low-Quality RTP Stream

Josh Dickson joshdickson40 at gmail.com
Fri May 12 17:50:24 UTC 2017


Hi Jan,

Thank you, that is definitely what I need. I have gotten that pipeline working successfully, but now when I play it (via ffplay), it sounds comically slow/distorted.

I am now using the pipeline:

gst-launch-1.0 -m filesrc location=myfile.wav ! wavparse ! audioconvert ! rtpL16pay ! udpsink host=127.0.0.1 port=12008

I used the -v option to produce what I thought was a correct SDP file:

v=0

o=root IN IP4 127.0.0.1

c=IN IP4 127.0.0.1

s=My Name

m=audio 12008 RTP/AVP 96

a=rtpmap:96 L16/44100

a=fmtp:96 media=audio; clock-rate=44100; encoding-name=L16; channels=2;

I am playing the sound with:

ffplay -i stream.sdp -protocol_whitelist file,udp,rtp

Ffplay does open, and the sound resembles the original song, but it is very slowed down/distorted. 

Ffplay sees:

bitrate: 705 kb/s

    Stream #0:0: Audio: pcm_s16be, 44100 Hz, 1 channels, s16, 705 kb/s

(not sure if that will help)

I have been trying to research what is wrong here but I am not sure what part of this I’ve messed up. Any help would be much appreciated. Thank you!

Josh

On Fri, May 12, 2017 at 01:39 Jan Schmidt

<
mailto:Jan Schmidt <thaytan at noraisin.net>
> wrote:

a, pre, code, a:link, body { word-wrap: break-word !important; }

Hi,

On 12/05/17 14:43, Josh Dickson wrote:

Hi,

I am sorry in advance if this is not the correct place to ask a question…

I am trying to convert a high-quality WAV file to RTP stream. I am successfully streaming with:

gst-launch-1.0 -m filesrc location=myfile.wav ! wavparse ! audioconvert ! audioresample ! alawenc ! rtppcmapay ! udpsink host=127.0.0.1 port=12000

alaw is 8-bit @ 8khz and will generally sound awful for anything except speech. Try rtpL16pay for 16-bit CD quality audio.

Cheers,

Jan.

I can then check the RTP stream from ffmpeg, which shows that is is 64 kb/s, pct_alaw, 8000 Hz, 1 channel, s16.

My WAV file is much higher quality than this (it is a sample of music at CD quality). I thought that the problem was with audioresample, but I have tried a number of changes and I cannot get any of them to stream correctly. Ideally the stream should be as high-quality as the WAV it’s generated from.

I would greatly appreciate a pointer on how I might be able to do this. Thank you!

Josh

_______________________________________________ gstreamer-devel mailing list
mailto:gstreamer-devel at lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20170512/ccc7c5f0/attachment.html>


More information about the gstreamer-devel mailing list