[FFmpeg-user] Transcode live mp3 stream to CBR aac+ with ffmpeg
Chip
chiapas at aktivix.org
Tue May 12 13:02:54 CEST 2015
Hi
First time posting.
I'm currently using liquidsoap to transcode a live MP3 stream to a
lower bitrate AAC+ stream. However the AAC+ stream is not suitable
because it is VBR and we require CBR. There appears to be no way to
set CBR within liquidsoap. The input MP3 stream is CBR.
I am therefore now trying to accomplish this with ffmpeg. I am running
Debian version 7.8 and ffmpeg version below:
ffmpeg version 1.0.10 Copyright (c) 2000-2014 the FFmpeg developers
built on Jul 25 2014 07:50:40 with gcc 4.7 (Debian 4.7.2-5)
configuration: --prefix=/usr --extra-cflags='-g -O2
-fstack-protector --param=ssp-buffer-size=4 -Wformat
-Werror=format-security ' --extra-ldflags='-Wl,-z,relro' --cc='ccache
cc' --enable-shared --enable-libmp3lame --enable-gpl --enable-nonfree
--enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid
--enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264
--enable-libspeex --enable-nonfree --disable-stripping --enable-libvpx
--enable-libschroedinger --disable-encoder=libschroedinger
--enable-version3 --enable-libopenjpeg --enable-librtmp
--enable-avfilter --enable-libfreetype --enable-libvo-aacenc
--disable-decoder=amrnb --enable-libvo-amrwbenc --enable-libaacplus
--libdir=/usr/lib/x86_64-linux-gnu --disable-vda --enable-libbluray
--enable-libcdio --enable-gnutls --enable-frei0r --enable-openssl
--enable-libass --enable-libopus --enable-fontconfig
--enable-libfdk-aac --enable-libdc1394 --disable-altivec --dis
libavutil 51. 73.101 / 51. 73.101
libavcodec 54. 59.100 / 54. 59.100
libavformat 54. 29.104 / 54. 29.104
libavdevice 54. 2.101 / 54. 2.101
libavfilter 3. 17.100 / 3. 17.100
libswscale 2. 1.101 / 2. 1.101
libswresample 0. 15.100 / 0. 15.100
libpostproc 52. 0.100 / 52. 0.100
I have tried various combinations of commands and I think this gets me
closest - stream details amended to protect the guilty:
/usr/bin/ffmpeg -re -user-agent 42 -i
http://example1.com:8002/stream.mp3 -c:a libfaac -ar 44100 -ab 48k
-acodec copy http://username:password@example2.com:8099/stream.aac -v
debug
The output of the above gives me the following:
user at machine:~# /usr/bin/ffmpeg -re -user-agent 42 -i
http://example1.com:8002/stream.mp3 -c:a libfaac -ar 44100 -ab 48k
-acodec copy http://username:password@example2.com:8099/stream.aac -v
debug
ffmpeg version 1.0.10 Copyright (c) 2000-2014 the FFmpeg developers
built on Jul 25 2014 07:50:40 with gcc 4.7 (Debian 4.7.2-5)
configuration: --prefix=/usr --extra-cflags='-g -O2
-fstack-protector --param=ssp-buffer-size=4 -Wformat
-Werror=format-security ' --extra-ldflags='-Wl,-z,relro' --cc='ccache
cc' --enable-shared --enable-libmp3lame --enable-gpl --enable-nonfree
--enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid
--enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264
--enable-libspeex --enable-nonfree --disable-stripping --enable-libvpx
--enable-libschroedinger --disable-encoder=libschroedinger
--enable-version3 --enable-libopenjpeg --enable-librtmp
--enable-avfilter --enable-libfreetype --enable-libvo-aacenc
--disable-decoder=amrnb --enable-libvo-amrwbenc --enable-libaacplus
--libdir=/usr/lib/x86_64-linux-gnu --disable-vda --enable-libbluray
--enable-libcdio --enable-gnutls --enable-frei0r --enable-openssl
--enable-libass --enable-libopus --enable-fontconfig
--enable-libfdk-aac --enable-libdc1394 --disable-altivec --dis
libavutil 51. 73.101 / 51. 73.101
libavcodec 54. 59.100 / 54. 59.100
libavformat 54. 29.104 / 54. 29.104
libavdevice 54. 2.101 / 54. 2.101
libavfilter 3. 17.100 / 3. 17.100
libswscale 2. 1.101 / 2. 1.101
libswresample 0. 15.100 / 0. 15.100
libpostproc 52. 0.100 / 52. 0.100
[mp3 @ 0x134ee20] Format mp3 probed with size=131072 and score=50
[mp3 @ 0x134ee20] File position before avformat_find_stream_info() is 0
[mp3 @ 0x1358720] Header missing
[mp3 @ 0x134ee20] max_analyze_duration 5000000 reached at 5015510
[mp3 @ 0x134ee20] Estimating duration from bitrate, this may be inaccurate
[mp3 @ 0x134ee20] File position after avformat_find_stream_info() is 81920
Input #0, mp3, from 'http://example1.com:8002/stream.mp3':
Duration: N/A, start: 0.000000, bitrate: 128 kb/s
Stream #0:0, 194, 1/14112000: Audio: mp3, 44100 Hz, stereo, s16, 128 kb/s
Output #0, adts, to
'http://username:password@example2.com:8099/stream.aac -v debug':
Metadata:
encoder : Lavf54.29.104
Stream #0:0, 0, 1/90000: Audio: mp3, 44100 Hz, stereo, 128 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
But no ffmpeg process is running and consequently no transcoded stream
is available.
Any suggestions. All help gratefully received.
Best regards
Chip Scooter
More information about the ffmpeg-user
mailing list