[FFserver-user] stream audio - can't make it working

Michal Tausk mtausk at gmail.com
Tue Jan 17 11:49:23 CET 2012


Hi there,

I would like to stream audio only, eg. mp3 or aac, whatever - I prefer 
AAC so that it might be streamable from mobiles... I was trying to get 
it working, but I think I came to my end and I need your help.

Please, what are the correct parameters in ffserver.conf and what are 
the next steps to successfully stream an audio.

ffmpeg version N-36891-g7e62315 Copyright (c) 2000-2012 the FFmpeg 
developers
   built on Jan 17 2012 09:27:16 with gcc 4.3.2

This is what I have in my config so far:
====================================================================================
Port 8999
RTSPPort 8998
BindAddress 0.0.0.0
MaxHTTPConnections 500
MaxClients 300
MaxBandwidth 1000
CustomLog -
NoDaemon

<Feed feed1.ffm>
File /home/mtausk/miso/feed1.ffm
FileMaxSize 100M
ACL allow localhost
</Feed>

<Stream live.aac>
Format rtp #tried rtsp also
Feed feed1.ffm
NoVideo

AudioCodec libfaac
AudioBitRate 32
AudioChannels 1
AudioSampleRate 22050
AVOptionAudio flags +global_header
</Stream>


<Stream test.mp3>
Format rtp
File "/home/mtausk/rema/web/hit/2011/20111228-St.mp3"
</Stream>
====================================================================================

These are the steps I use:

1. start the server:
../builds/ffmpeg/ffserver -f ffserver.conf
2. run the ffmpeg against the feed:
~/builds/ffmpeg/ffmpeg -i 20111228-St.mp3 http://localhost:8999/feed1.ffm

everything seems fine:
...
     encoder         : Lavf53.30.100
     Stream #0:0: Audio: aac, 22050 Hz, 1 channels, s16, 32 kb/s
...
video:0kB audio:36444kB global headers:0kB muxing overhead 9.001147%

3. run mplayer or ffplay from outside - with the result:

bash-4.1$ mplayer rtsp://92.240.234.34:8998/live.aac
MPlayer Sherpya-MT-SVN-r32848-4.2.5 (C) 2000-2011 MPlayer Team

Playing rtsp://92.240.234.34:8998/live.aac.
Connecting to server 92.240.234.34[92.240.234.34]: 8998...

rtsp_session: unsupported RTSP server. Server type is 'unknown'.
STREAM_LIVE555, URL: rtsp://92.240.234.34:8998/live.aac
Stream not seekable!
  file format detected.
Initiated "audio/MPEG4-GENERIC" RTP subsession on port 4774
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
Unknown/missing audio format -> no sound
ADecoder init failed :(
Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
FAAD: compressed input bitrate missing, assuming 128kbit/s!
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
AO: [dsound] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...


Exiting... (End of file)

-------------------------------------------------------------------------------------------------------------------------------------

I don't hear anything, it stops immediately.

ffmpeg:

bash-4.1$ ffplay rtsp://92.240.234.34:8998/live.aac
FFplay version SVN-r25512, Copyright (c) 2003-2010 the FFmpeg developers
   built on Oct 18 2010 04:06:45 with gcc 4.4.2
   configuration: --enable-gpl --enable-version3 --enable-libgsm 
--enable-pthreads --enable-libvorbis --enable-libtheora 
--enable-libspeex --enable-libmp3lame --enable-lib
openjpeg --enable-libschroedinger --enable-libopencore_amrwb 
--enable-libopencore_amrnb --enable-libvpx --arch=x86 
--enable-runtime-cpudetect --enable-libxvid --enable-li
bx264 --extra-libs='-lx264 -lpthread' --enable-librtmp 
--extra-libs='-lrtmp -lpolarssl -lws2_32 -lwinmm' --target-os=mingw32 
--enable-avisynth --cross-prefix=i686-mingw32
- --cc='ccache i686-mingw32-gcc' --enable-memalign-hack
   libavutil     50.32. 3 / 50.32. 3
   libavcore      0. 9. 1 /  0. 9. 1
   libavcodec    52.92. 0 / 52.92. 0
   libavformat   52.83. 0 / 52.83. 0
   libavdevice   52. 2. 2 / 52. 2. 2
   libavfilter    1.52. 0 /  1.52. 0
   libswscale     0.12. 0 /  0.12. 0
[rtsp @ 02320380] Could not find codec parameters (Audio: aac, mono, s16)
[rtsp @ 02320380] Estimating duration from bitrate, this may be inaccurate
rtsp://92.240.234.34:8998/live.aac: could not find codec parameters

-------------------------------------------------------------------------------------------------------------------------------------


On the server side I see:

Tue Jan 17 11:39:16 2012 Opening file 
'/home/mtausk/rema/web/hit/2011/20111228-St.mp3'
Tue Jan 17 11:39:16 2012 [mp3 @ 0x1528300]max_analyze_duration 5000000 
reached at 5004000
Tue Jan 17 11:39:16 2012 Codec bitrates do not match for stream 0
Tue Jan 17 11:39:16 2012 FFserver started.
Tue Jan 17 11:39:21 2012 127.0.0.1 - - [GET] "/feed1.ffm HTTP/1.1" 200 4175
Tue Jan 17 11:39:36 2012 85.237.224.43 - - [DESCRIBE] 
"rtsp://92.240.234.34:8998/live.aac RTSP/1.0" 200 542
Tue Jan 17 11:39:42 2012 85.237.224.43:4762 - - "PLAY 
live.aac/streamid=0 RTP/UDP"
Tue Jan 17 11:39:53 2012 85.237.224.43 - - [TEARDOWN] 
"rtsp://92.240.234.34:8998/live.aac/ RTSP/1.0" 200 811
Tue Jan 17 11:41:54 2012 127.0.0.1 - - [POST] "/feed1.ffm HTTP/1.1" 200 
40677376
Tue Jan 17 11:44:00 2012 85.237.224.43 - - [DESCRIBE] 
"rtsp://92.240.234.34:8998/live.aac RTSP/1.0" 200 542
Tue Jan 17 11:44:05 2012 85.237.224.43:4774 - - "PLAY 
live.aac/streamid=0 RTP/UDP"
Tue Jan 17 11:44:16 2012 85.237.224.43 - - [TEARDOWN] 
"rtsp://92.240.234.34:8998/live.aac/ RTSP/1.0" 200 811
Tue Jan 17 11:46:05 2012 85.237.224.43:5000 - - "PLAY 
live.aac/streamid=0 RTP/UDP"
Tue Jan 17 11:46:16 2012 85.237.224.43 - - [TEARDOWN] 
"rtsp://92.240.234.34:8998/live.aac RTSP/1.0" 200 896


-------------------------------------------------------------------------------------------------------------------------------------

Maybe you can provide some working example for streaming audio file - 
that might help me a lot.


Thanks for your help and effort!

Michal



More information about the ffserver-user mailing list