[FFmpeg-user] ffserver consuming 100% CPU forever for streaming live video

Marcos Alessandro Moura marcosocram at gmail.com
Thu Feb 6 19:40:55 CET 2014


Hi,

I have an application that transcodes video streams in H.264 and mpeg
formats for webm and sends it to a feed ffserver so that it makes available
on the network . The problem is that at random moments transcoding breaks
and ffserver consuming 100% CPU forever blocking any attempt to iterate
through it. You must restart the ffserver to solve the problem .

Analyzing http_receive_data function ffserver I noticed that the process
goes by the code
...
if ( len < 0 ) {
            if ( ff_neterrno ( ) ! = AVERROR ( EAGAIN ) &&
                ff_neterrno ( !) = AVERROR ( EINTR ) )
                / * Error : close connection * /
                *goto fail ;*
            return 0;
        }
...

and go to fail
...
fail:
    c - > stream- > feed_opened = 0 ;
    close ( c- > feed_fd );
    / * Wake up any waiting connections to stop waiting for feed * /
    for ( c1 = first_http_ctx ; c1 = NULL ; ! c1 = c1 -> next ) {
        if ( c1 -> state == && HTTPSTATE_WAIT_FEED
            c1 - > stream- > feed == c - > stream- > feed )
            *c1 -> state = HTTPSTATE_SEND_DATA_TRAILER ;*
    }
    return -1;
...

When the state variable c1 is changed to HTTPSTATE_SEND_DATA_TRAILER the
ffserver gets lost and starts to consume 100 % CPU.

Anyone have any idea what may be happening to the state of the variable  c1
being changed to HTTPSTATE_SEND_DATA_TRAILER?

When I comment the line *c1-> state = HTTPSTATE_SEND_DATA_TRAILER;* the
ffserver works perfectly.


*Att,*



*Marcos Alessandro Moura Gmail:  marcosocram at gmail.com
<marcosocram at gmail.com> "Antes de imprimir pense na sua responsabilidade e
compromisso com o meio ambiente" *


More information about the ffmpeg-user mailing list