[FFmpeg-user] Problem using FFMpeg, x11grab, and FFServer

Stefano Sabatini stefasab at gmail.com
Sat Aug 2 19:37:11 CEST 2014


On date Tuesday 2014-07-29 23:01:15 -0500, Joel Longanecker wrote:
> Hey guys. Trying an experiment with FFMpeg. The end goal is to serve the
> output of an xvfb session over the web and display it on a web page. I
> think i've narrowed down my problem to the parameters I am calling ffmpeg
> with.
> 
>     ffmpegProcess = subprocess.Popen(['ffmpeg',
> '-f', 'x11grab',
> '-r', '25',
> '-s', '640x480',
> '-i', ':1.0',
> '-pix_fmt', 'yuv420p',
> '-preset', 'medium',
> 'http://localhost:8090/feed1.ffm'])
> 
> and here is my steam that I am trying to serve.
> 
>     <Stream live.flv>
> Feed feed1.ffm
>         Format flv
>         VideoCodec libx264
> 
>         AVOptionVideo crf 18
> 
>         AVOptionVideo preset ultrafast
> 
>         NoAudio
> 
>         VideoSize 640x480
>     </Stream>
> 
> And here are the errors I am getting.
> 
>     [tcp @ 0x733b60] TCP connection to localhost:8090 failed: Connection
> refused
>     Tue Jul 29 22:15:48 2014 127.0.0.1 - - [GET] "/feed1.ffm HTTP/1.1" 200
> 4175
>     [tcp @ 0x73bbe0] TCP connection to localhost:8090 failed: Connection
> refused
>     [libx264 @ 0x73e4e0] broken ffmpeg default settings detected
>     [libx264 @ 0x73e4e0] use an encoding preset (e.g. -vpre medium)
>     [libx264 @ 0x73e4e0] preset usage: -vpre <speed> -vpre <profile>
>     [libx264 @ 0x73e4e0] speed presets are listed in x264 --help
>     [libx264 @ 0x73e4e0] profile is optional; x264 defaults to high
>     Output #0, ffm, to 'http://localhost:8090/feed1.ffm':
>       Metadata:
>         creation_time   : now
>         Stream #0:0: Video: h264, yuv444p, 640x480, q=2-31, 128 kb/s, 1000k
> tbn, 25 tbc
>     Stream mapping:
>       Stream #0:0 -> #0:0 (rawvideo -> libx264)
>     Error while opening encoder for output stream #0:0 - maybe incorrect
> parameters such as bit_rate, rate, width or height

This is a known ffserver limitation. You need to set the parameters on
the ffmpeg side, using -override_ffserver. This is due to the fact
that you can set only a limited number of options from the ffserver
configuration file.

See http://trac.ffmpeg.org/ticket/1275


More information about the ffmpeg-user mailing list