【问题标题】:How to Transcode Opus codec to G.711 codec in C#如何在 C# 中将 Opus 编解码器转码为 G.711 编解码器
【发布时间】:2020-08-14 15:46:28
【问题描述】:

我目前正在使用 Mumble VoIP 1.2.X 服务器-客户端通信协议。我的工作是创建一个桌面客户端,客户端与服务器连接并接收其他客户端的音频流。我在 opus 编解码器中接收流。我可以对其进行解码,也可以使用 NAudio 库进行播放。现在我需要将 opus 编解码器流转码为 G.711 ulaw 编解码器。这样,我就可以使用 UDP 在多播广播频道中播放转码流。

【问题讨论】:

    标签: c# udp opus mu-law g.711


    【解决方案1】:

    使用 c#,你可以运行 ffmpeg.exe,它应该让你:

    1. 将 Opus 流作为输入
    2. 转码为 G.711u
    3. 使用 UDP 将其转发到您的电台

    这是一个执行最后两个步骤的示例:

    //listen to the microphone, transcode to G.711u, send it over UDP to a multicast listener
        ffmpeg -f dshow -i audio="Microphone (Logitech USB Headset H340)" -ac 1 -ar 8000 -ab 64 -acodec pcm_mulaw -f rtp rtp://239.0.0.1:5656
    

    还有一些其他可能有用的例子:

    //list input devices
        ffmpeg -list_devices true -f dshow -i dummy
            
    //record microphone to mp3
        ffmpeg -f dshow -i audio="Microphone (Logitech USB Headset H340)" -c:a libmp3lame -ar 44100 -b:a 320k -ac 1 output1.mp3
                        
    //play audio going to the radio
        ffplay rtp://239.0.0.1:5656
    
    //play audio coming from the radio
        ffplay rtp://239.0.0.2:5656
                    
    //receive rtp multicast g.711 and save to mp3       
        ffmpeg -i rtp://239.0.0.1:5656 -filter:a "asetrate=8000" -acodec libmp3lame -ar 44100 output2.mp3
    

    【讨论】:

      猜你喜欢
      • 2016-10-30
      • 1970-01-01
      • 1970-01-01
      • 2013-12-31
      • 2020-06-20
      • 2018-08-31
      • 2020-08-01
      • 2015-10-23
      • 2013-07-26
      相关资源
      最近更新 更多