Is there a simple way to stream video with ffmpeg into icesast? Source video is in video/x-matroska format. Streams themselves are in various formats (mpeg, vorbis, aac, etc.). I want ffmpeg to guess source on it's own and then trans-code it into anything playable by browsers "on the fly", keeping source resolution and aspect ratio. video/webm will do. I tried doing this (Including playing with output formats):

ffmpeg -i source.mkv -vcodec libvpx -cpu-used -5 -deadline realtime -content_type video/webm\

But stream is not playable and connections cause ffmpeg to terminate with following error:

av_interleaved_write_frame(): Connection reset by peer
Error writing trailer of icecast://source:hackme@localhost:8000/vstream.webm: Connection reset by peer

Involving anything besides ffmpeg is fine, I just want it to work.

3 Answers 3


Turns out it is either hard to achieve or is not possible at all. Nevertheless, it is possible to achieve something similar with combination of nginx (with rtmp module) and ffmpeg. In nginx config (Probably located at /etc/nginx/nginx.conf) following section should be appended to make it work as rtmp server (With full public access. Be careful, stream is not encrypted and anyone capable of reaching your network can watch it):

rtmp {
    server {
        listen 1935;
        chunk_size 4096;

        application live {
            live on;
            record off;
            allow play all;

Then streaming video file is as easy as invoking ffmpeg like this:

ffmpeg -re -i video_file.mkv -c:v libx264 -f flv rtmp://host:1935/live

Finally, anyone who want to watch the stream should connect to the very same address with their player of choice:


Note: host here is the host name of the server where nginx is launched.


short answer, you can't , because icecast is a audio streaming system, not a video streaming server.

  • 1
    From official website: "Icecast is a streaming media (audio/**video**) server which currently supports Ogg (Vorbis and Theora), Opus, WebM and MP3 streams."
    – L117
    Feb 10, 2021 at 1:24

With obs it works just fine, haven't tried with ffmpeg though. And obs has the advantage that you get player controls to seek back and forth. I followed this guide and it's very easy:


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .