FFmpeg 将多个音轨流式传输到 icecast

FFmpeg 将多个音轨流式传输到 icecast

我想将多个音轨流式传输到 Icecast。输入是来自同一服务器的 FLAC 流,输出具有不同的比特率。问题是,如果我删除最后 3 个流,第一个流就可以正常工作。如果不行,第二个流和下一个流可能都会出现错误 403。

方案:https://i.stack.imgur.com/f50VP.png

ffmpeg -i http://localhost:8000/stream
-c:a libopus -b:a 128k -f ogg  -content_type application/ogg icecast://source:test@localhost:8000/opus
-c:a libopus -b:a 96k -f ogg  -content_type application/ogg icecast://source:test@localhost:8000/opus96
-c:a libopus -b:a 64k -f ogg  -content_type application/ogg icecast://source:test@localhost:8000/opus64
-c:a libopus -b:a 48k -f ogg  -content_type application/ogg icecast://source:test@localhost:8000/opus48

ffmpeg version N-92418-gee47ac97d7 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20181017
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 23.101 / 56. 23.101
  libavcodec     58. 39.100 / 58. 39.100
  libavformat    58. 22.100 / 58. 22.100
  libavdevice    58.  6.100 / 58.  6.100
  libavfilter     7. 43.100 /  7. 43.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Input #0, ogg, from 'http://localhost:8000/stream':
  Metadata:
    icy-br          : 160
    icy-name        : no name
    icy-pub         : 0
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Audio: flac, 48000 Hz, stereo, s16
[http @ 00000216144d7f80] HTTP error 403 Forbidden
icecast://source:test@localhost:8000/opus96: Server returned 403 Forbidden (access denied)

答案1

Icecast 处于默认配置吗?

默认情况下,Icecast 设置为允许同时进行 2 个源连接。
https://icecast.org/docs/icecast-2.4.1/config-file.html#limits

<limits>
    <sources>2</sources>
</limits>

编辑 Icecast 配置后,您必须重新启动它或向其发送 SIGHUP。

您还可以在error.logIcecast 中查看详细信息。

相关内容