[FFmpeg-user] Why doesn't this live audio streaming from ffmpeg to ffserver work, except for a tiny bit of audio when I kill ffmpeg?

Andrew Widgery awidgery at gmail.com
Mon Dec 21 14:09:50 CET 2015


Hi all,

I have a USB mic plugged in, and it works:

ffmpeg -f alsa -i plughw:1,0 -acodec libmp3lame -t 15 out.mp3

out.mp3 contains audio from the mic.

I have an ffserver config:

Port 8090
<Stream status.html>
Format status
</Stream>

<Feed feed1.ffm>
</Feed>

<Stream test.mp3>
Feed feed1.ffm
Format mp3
AudioCodec libmp3lame
AudioBitRate 128
AudioChannels 1
AudioSampleRate 44100
NoVideo
</Stream>

If I start ffserver and then run:

ffmpeg -i out.mp3 http://localhost:8090/feed1.ffm

I can then access http://mydevice.local:8090/test.mp3 and I can hear
out.mp3 being streamed.

However, I want live audio streaming from the mic. So, I instead run:

ffmpeg -f alsa -i plughw:1,0 http://localhost:8090/feed1.ffm

In this instance I can connect to http://mydevice.local:8090/test.mp3
and it connects and plays, but I hear nothing (I've waited . When,
however, I go back and kill (either Ctrl-C or pressing q) the ffmpeg
command above, I hear a brief (<1s) bit of audio that is coming live
from the microphone.

Any ideas why?

ffmpeg info:

ffmpeg version N-77183-g9553689 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.9.2 (Raspbian 4.9.2-10)
  configuration: --enable-libfreetype --enable-gpl --enable-nonfree
--enable-libass --enable-libmp3lame --bindir=/usr/local/bin
  libavutil      55. 10.100 / 55. 10.100
  libavcodec     57. 17.100 / 57. 17.100
  libavformat    57. 19.100 / 57. 19.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 20.100 /  6. 20.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100

ffserver info:

ffserver version N-77183-g9553689 Copyright (c) 2000-2015 the FFmpeg developers


More information about the ffmpeg-user mailing list