ffmpeg 广播直播转码 mp3/aac 到 g722
ffmpeg radio live transcoding mp3/aac to g722
我尝试将带有 ffmpeg 的广播流转码为 g722。
我让流媒体工作并且无法收听流媒体。
问题是输出流的速度比输入流快。
所以结果不好。我试过用atempo减慢速度,但没有成功。
喜欢:
size= 241kB time=00:00:28.67 bitrate= 68.8kbits/s speed= 1.4x
从 1.x 到 15.x
控制台输出:
c:\ffmpeg\bin>ffmpeg -i http://lyd.nrk.no/nrk_radio_mp3_mp3_l -ac 1 -acodec g722 -f rtp -ab 64k -ar 16k rtp://192.168.0.99:555
ffmpeg version N-85750-ga75ef15 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 6.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 61.100 / 55. 61.100
libavcodec 57. 93.100 / 57. 93.100
libavformat 57. 72.101 / 57. 72.101
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 88.100 / 6. 88.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
Input #0, mp3, from 'http://lyd.nrk.no/nrk_radio_mp3_mp3_l':
Metadata:
icy-name : NRK mP3
icy-pub : 1
Duration: N/A, start: 0.000000, bitrate: 96 kb/s
Stream #0:0: Audio: mp3, 48000 Hz, stereo, s16p, 96 kb/s
[udp @ 000000000244bec0] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
[udp @ 00000000024781a0] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
Stream mapping:
Stream #0:0 -> #0:0 (mp3 (native) -> adpcm_g722 (g722))
Press [q] to stop, [?] for help
Output #0, rtp, to 'rtp://192.168.0.99:555':
Metadata:
icy-name : NRK mP3
icy-pub : 1
encoder : Lavf57.72.101
Stream #0:0: Audio: adpcm_g722 (g722), 16000 Hz, mono, s16, 64 kb/s
Metadata:
encoder : Lavc57.93.100 g722
SDP:
v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
c=IN IP4 192.168.0.99
t=0 0
a=tool:libavformat 57.72.101
m=audio 555 RTP/AVP 9
b=AS:64
size= 413kB time=00:00:49.17 bitrate= 68.8kbits/s speed=1.43x
有谁知道我做错了什么?
谢谢
The problem is that the output stream have faster speed than the input stream
你确定吗?如果是这样,问题就归结为采样率。播放端(在 FFmpeg 之后)以比您从 FFmpeg 输出的采样率更高的采样率播放。
我怀疑这并没有真正发生,但基于这条评论:
this varies from 1.x to 15.x
当您连接到互联网广播流时,将尽快向您刷新一个大缓冲区。这可以让玩家快速启动。对于你的FFmpeg命令来说,意味着当你第一次连接的时候,FFmpeg也会以最快的速度处理这个数据并发送过来。如果终端播放设备正在缓冲数据,这通常没问题。如果不是,则必须强制 FFmpeg 缓冲数据。
您可以通过在输入前指定 -re
参数来实现。这将根据软件定义的时钟实时强制输入 运行。
我尝试将带有 ffmpeg 的广播流转码为 g722。 我让流媒体工作并且无法收听流媒体。 问题是输出流的速度比输入流快。 所以结果不好。我试过用atempo减慢速度,但没有成功。
喜欢:
size= 241kB time=00:00:28.67 bitrate= 68.8kbits/s speed= 1.4x
从 1.x 到 15.x
控制台输出:
c:\ffmpeg\bin>ffmpeg -i http://lyd.nrk.no/nrk_radio_mp3_mp3_l -ac 1 -acodec g722 -f rtp -ab 64k -ar 16k rtp://192.168.0.99:555
ffmpeg version N-85750-ga75ef15 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 6.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 61.100 / 55. 61.100
libavcodec 57. 93.100 / 57. 93.100
libavformat 57. 72.101 / 57. 72.101
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 88.100 / 6. 88.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
Input #0, mp3, from 'http://lyd.nrk.no/nrk_radio_mp3_mp3_l':
Metadata:
icy-name : NRK mP3
icy-pub : 1
Duration: N/A, start: 0.000000, bitrate: 96 kb/s
Stream #0:0: Audio: mp3, 48000 Hz, stereo, s16p, 96 kb/s
[udp @ 000000000244bec0] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
[udp @ 00000000024781a0] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
Stream mapping:
Stream #0:0 -> #0:0 (mp3 (native) -> adpcm_g722 (g722))
Press [q] to stop, [?] for help
Output #0, rtp, to 'rtp://192.168.0.99:555':
Metadata:
icy-name : NRK mP3
icy-pub : 1
encoder : Lavf57.72.101
Stream #0:0: Audio: adpcm_g722 (g722), 16000 Hz, mono, s16, 64 kb/s
Metadata:
encoder : Lavc57.93.100 g722
SDP:
v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
c=IN IP4 192.168.0.99
t=0 0
a=tool:libavformat 57.72.101
m=audio 555 RTP/AVP 9
b=AS:64
size= 413kB time=00:00:49.17 bitrate= 68.8kbits/s speed=1.43x
有谁知道我做错了什么? 谢谢
The problem is that the output stream have faster speed than the input stream
你确定吗?如果是这样,问题就归结为采样率。播放端(在 FFmpeg 之后)以比您从 FFmpeg 输出的采样率更高的采样率播放。
我怀疑这并没有真正发生,但基于这条评论:
this varies from 1.x to 15.x
当您连接到互联网广播流时,将尽快向您刷新一个大缓冲区。这可以让玩家快速启动。对于你的FFmpeg命令来说,意味着当你第一次连接的时候,FFmpeg也会以最快的速度处理这个数据并发送过来。如果终端播放设备正在缓冲数据,这通常没问题。如果不是,则必须强制 FFmpeg 缓冲数据。
您可以通过在输入前指定 -re
参数来实现。这将根据软件定义的时钟实时强制输入 运行。