[FFmpeg-user] ffserver HTTP stream playback freeze

Stefano Sabatini stefasab at gmail.com
Wed Dec 18 19:49:27 CET 2013


I'm trying to debug this but since it's starting to take much time I
wonder if someone already got the same issue, and found a fix for it.

Scenario: I'm generating a stream with ffmpeg, which is then sent to
ffserver and published as an HTTP resource.

Problem: at some point the published stream is interrupted, I usually
get decoding errors on the client (probably due to a segmented
packet), and the player freezes. If I now restart the player, the
stream will be played again until the next freeze. Many instances of
player/downloader can be created at the same time, and each one seems
to freeze independently from the others.

The freezeing time usually is just a few seconds, but the playback
duration varies from a few seconds to dozens of seconds.

If I use ffplay or vlc the stream usually freezes after few seconds,
but playback seems to last much more if I download the stream with
wget instead (so it may be somehow related to the TCP/HTTP session
between ffplay and ffserver).

I tried several combinations, changing output container, video codec,
and bitrate, but it doesn't seem to affect the issue.

Curiously, I get this problem only when I play the stream from a
remote machine.

Here are some basic instructions to reproduce the issue:

ffserver.conf file:
Port 8090
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 60000
CustomLog -

<Feed testsrc.ffm>
File /tmp/testsrc.ffm
FileMaxSize 200K
ACL allow
ACL allow localhost

<Stream testsrc>
Feed testsrc.ffm
Format flv
VideoCodec flv

<Stream status.html>
Format status

To generate the testing stream:
ffserver -f ffserver.test.conf &
ffmpeg -override_ffserver -re -f lavfi -i testsrc -pix_fmt yuv420p -s vga -codec:v flv -b:v 500k http://localhost:8090/testsrc.ffm -nostats

Then on a remote machine:
ffplay http://$FFSERVER_IP:8090/testsrc
wget http://$FFSERVER_IP:8090/testsrc

The same issue can be observed checking the
http://$FFSERVER_IP:8090/status.html page, when the strean freezes the
transferred bytes count stops.


Reports of such or similar issues, suggestions or debugging hints are
very welcome.

More information about the ffmpeg-user mailing list