Good day.

I would like to organize the broadcast of your computer’s screen on the Internet so that you can open a link to the broadcast in the browser and see if you can tell it in principle with ffmpeg and ffserver + what kind of web server that will give the html page with the video block and how mp4 player? I read the documentation, looked at the Internet, it seems to be possible, but for sure there are a lot of little things like the correct codec, its parameters, etc. I tried to run with the following parameters:

ffserver.conf (found somewhere on the Internet):

HTTPPort 8090 HTTPBindAddress 0.0.0.0 MaxHTTPConnections 2000 MaxClients 1000 MaxBandwidth 10000 CustomLog - <Feed av_feed.ffm> File /tmp/av_feed.ffm FileMaxSize 1G ACL allow 127.0.0.1 </Feed> <Feed streamwebm.ffm> File /tmp/streamwebm.ffm FileMaxSize 50M ACL allow 127.0.0.1 </Feed> <Stream streamwebm> Feed streamwebm.ffm Format webm # Video Settings VideoFrameRate 10 VideoSize 1920x1080 # Audio settings AudioCodec libvorbis AudioSampleRate 48000 AVOptionAudio flags +global_header MaxTime 0 AVOptionVideo me_range 16 AVOptionVideo qdiff 4 AVOptionVideo qmin 4 AVOptionVideo qmax 40 #AVOptionVideo good AVOptionVideo flags +global_header # Streaming settings PreRoll 10 StartSendOnKey Metadata author "author" Metadata copyright "copyright" Metadata title "Web app name" Metadata comment "comment" </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> 

so i run ffmpeg:

 ffmpeg -f x11grab -s 1920x1080 -r 10 -i $DISPLAY -f alsa -i default -c:v libvpx -cpu-used 4 -threads 4 http://localhost:8090/streamwebm.ffm 

Next to ffserver, I launched an http server on port 8000 that gives this page:

 <html> <head> </head> <body> <video src="http://localhost:8090/streamwebm" controls></video> </body> </html> 

When I press the play button, nothing happens.

Knowledgeable people tell me what's wrong? Maybe it's easier to do this with other programs?

Thank.

    2 answers 2

    Never get a normal working system with ffserver. Take nginx-rtmp and set up streaming with it: it will be able to start ffmpeg itself with the necessary options. Well, or run the publication yourself after. How convenient it will be.

    • Thanks, I will try nginx. If it turns out I will inform. - mks
    • Yes, as far as I know, there are no HTML5 web players for rtmp. But I may not know something. - Monah Tuk
    • I support! ffserver some kind of very oblique. Even in icecast2, everything merges and works fine, not like here. By the way, the tour where nginx starts ffmpeg with each connection, to say the least, a curve: you don’t need to do that. One transcoder is needed for the entire broadcast, and not each client has its own. - gbg
    • @MonahTuk flowplayer in this sense is not bad enough - if it cannot load the flash engine, it jumps to HLS or WebM - gbg
    • one
      @gbg thanks for the tip. TSU will also be useful. - Monah Tuk

    Here is the 100% working configuration of the FFserver + FFmpeg bundle for the task of broadcasting video to the site here

    For screencast, change the call

     ffmpeg -s 352x288 -r 30 -f video4linux2 -i /dev/video0 http://localhost:8090/feed.ffm 

    for example on such

     ffmpeg -r 30 -g 500 -s 352x288 -f x11grab -i :0.0 -vcodec copy http://localhost:8090/feed1.ffm 
    • 2
      Reference links are not welcome due to the fact that the link may be invalid in the future. To improve, add the necessary code to your answer, the link should be as a source. - Denis
    • Thanks, I will try - mks
    • Now the message crashes: Missing audio stream
    • Add the option to disable audio -an: fmpeg -r 30 -g 500 -s 352x288 -f x11grab -i: 0.0 -an -vcodec copy localhost: 8090 / feed1.ffm - UGV