小编sam*_*sam的帖子

复用两个流后如何提高RTMP流的音频质量

使用GStreamer(gst-launch1.0),我正在复用两个流

  • 一个包含沉默
  • 其他包含语音语音

但是问题是音频输出的质量不好。声音失真。

我需要您的帮助来提高音频质量,这是我的gstreamer命令,带有参数:

  • 以下是我用于多路复用两个流的命令:

    gst-launch-1.0 -v udpsrc name='src1' caps="application/x-rtp" port= ! 
    rtppcmudepay ! mulawdec ! audioconvert ! audioresample ! mix. udpsrc 
    name='src2' caps="application/x-rtp" port= ! rtppcmudepay ! mulawdec ! 
    audioconvert ! audioresample ! mix. audiomixer name=mix start-time-selection=1 
    ! audioresample ! alawenc ! flvmux name=mux ! rtmpsink location=rtmp:server_ip
    
    Run Code Online (Sandbox Code Playgroud)
  • 以下是我用来提高音频质量的插件:

    audiochebband mode=band-pass lower-frequency= upper-frequency= type=2 ! 
    audioamplify amplification=0.5 clipping-method=wrap-positive
    
    Run Code Online (Sandbox Code Playgroud)

但是此插件也无法提高音频流的质量。

如果您能帮助我获得多路复用后的高质量音频输出,我将不胜感激。

python ubuntu audio-streaming gstreamer-1.0

6
推荐指数
1
解决办法
80
查看次数

我们可以直接将音频二进制数据写入gstreamer管道吗?

我想直接将二进制数据写入gstreamer管道,但无法这样做。

我试过了rawaudioparse插件。我已将二进制数据写入.raw文件,并尝试使用此命令播放此二进制数据。

gst-launch-1.0 filesrc location=audio.raw ! rawaudioparse use-sink-caps=false \
     format=pcm pcm-format=s16le sample-rate=48000 num-channels=2 \
     audioconvert ! audioresample ! autoaudiosink
Run Code Online (Sandbox Code Playgroud)

将音频二进制数据写入gstreamer管道,并作为RTMP流播放。

python python-3.x gstreamer-1.0

6
推荐指数
1
解决办法
58
查看次数