0

I am unable to send a stream to my ffserver.

I started the server with

ffserver -f /etc/ffserver.conf &

where ffserver.conf has not been modified. I tried sending a webcam stream with

ffmpeg -f alsa -ac 2 -i plughw:0,0 -f video4linux2 -s vga -i /dev/video0  http://localhost:8090/feed1.ffm

I have however the following error:

[...]
[tcp @ 0x560e1234c6e0] Connection to tcp://localhost:8090 failed (Connection  refused), trying next address

[...] MPEG-1/2 does not support 3/1 fps [...]

The port 9080 is open, as seen with nmap localhost

Why do I have this error and how to send my stream?


Full output:

# ffmpeg -f alsa -ac 2 -i plughw:0,0 -f video4linux2 -s vga -i /dev/video0  http://localhost:8090/feed1.ffm

ffmpeg version 3.2.1-1 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 6.2.1 (Debian 6.2.1-5) 20161124
  configuration: --prefix=/usr --extra-version=1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-libtesseract --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-libopencv --enable-frei0r --enable-libx264 --enable-chromaprint --enable-shared
  libavutil      55. 34.100 / 55. 34.100
  libavcodec     57. 64.101 / 57. 64.101
  libavformat    57. 56.100 / 57. 56.100
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libavresample   3.  1.  0 /  3.  1.  0
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, alsa, from 'plughw:0,0':
  Duration: N/A, start: 1481703954.356244, bitrate: 1536 kb/s
    Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Input #1, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 41830.241126, bitrate: 147456 kb/s
    Stream #1:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 147456 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
[tcp @ 0x560e6432c6e0] Connection to tcp://localhost:8090 failed (Connection refused), trying next address
[tcp @ 0x560e64345a40] Connection to tcp://localhost:8090 failed (Connection refused), trying next address
[mpeg1video @ 0x560e6435fb20] bitrate tolerance 21333 too small for bitrate 64000, overriding
[mpeg1video @ 0x560e6435fb20] MPEG-1/2 does not support 3/1 fps
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le (native) -> mp2 (native))
  Stream #1:0 -> #0:1 (rawvideo (native) -> mpeg1video (native))
  Stream #0:0 -> #0:2 (pcm_s16le (native) -> wmav2 (native))
  Stream #1:0 -> #0:3 (rawvideo (native) -> msmpeg4v3 (msmpeg4))
Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height

Full /etc/ffserver.conf (no modification from original file):

HTTPPort 8090
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 1000
CustomLog -
<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 200K
ACL allow 127.0.0.1
</Feed>
<Stream test1.mpg>
Feed feed1.ffm
Format mpeg
AudioBitRate 32
AudioChannels 1
AudioSampleRate 44100
VideoBitRate 64
VideoBufferSize 40
VideoFrameRate 3
VideoSize 160x128
VideoGopSize 12
</Stream>
<Stream test.asf>
Feed feed1.ffm
Format asf
VideoFrameRate 15
VideoSize 352x240
VideoBitRate 256
VideoBufferSize 40
VideoGopSize 30
AudioBitRate 64
StartSendOnKey
</Stream>
<Stream stat.html>
Format status
ACL allow localhost
ACL allow 192.168.0.0 192.168.255.255
</Stream>
<Redirect index.html>
URL http://www.ffmpeg.org/
</Redirect>
0

I used another ffserver.conf found here to make this work:

Port 8090 
# bind to all IPs aliased or not 
BindAddress 0.0.0.0 
# max number of simultaneous clients 
MaxClients 1000 
# max bandwidth per-client (kb/s) 
MaxBandwidth 10000 
# Suppress that if you want to launch ffserver as a daemon. 
NoDaemon 

<Feed feed1.ffm> 
File /tmp/feed1.ffm 
FileMaxSize 5M 
</Feed> 

<Stream test.swf>
Feed feed1.ffm
Format swf
VideoCodec flv
VideoFrameRate 15
VideoBufferSize 80000
VideoBitRate 100
VideoQMin 1
VideoQMax 5
VideoSize 352x288
PreRoll 0
Noaudio
</Stream>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.