View RTMP Stream on Raspberry Pi


Introduction: View RTMP Stream on Raspberry Pi

About: Engineer. Educator. Entrepreneur.

Here's a simple and straightforward technique to view RTMP streams on the Raspberry Pi.

For this, you will need the following installed on your R-Pi
- omxplayer (installed by default)
- mkfifo (installed by default)
- rtmpdump (not installed by default)

You can install rtmpdump by issuing the command 'sudo apt-get install rtmpdump' from any terminal window on the R-Pi.

First, create a named pipe. A named pipe is essentially a FIFO buffer memory which is referenced by a name. This named pipe will be used for dumping and viewing your stream. You can create a named pipe using the command ' mkfifo name_of_pipe  '

Now, use rtmpdump to read the live stream and dump it on to the named pipe you created earlier. Simultaneously, use omxplayer to play the content dumped on to the named pipe. This can be done with the following command:

rtmpdump -r rtmp://url_of_rtmp_stream --live -o name_of_pipe  | omxplayer name_of_pipe

At a Glance:

- Install rtmpdump
    sudo apt-get install rtmpdump
- Create Named Pipe
    mkfifo /tmp/livevideo
-Play RTMP stream
    rtmpdump -r rtmp://url_of_stream/ --live -o /tmp/livevideo | omxplayer /tmp/livevideo

Watch a video demonstration of this on the YouTube video linked here.



    • Clocks Contest

      Clocks Contest
    • Creative Misuse Contest

      Creative Misuse Contest
    • Water Contest

      Water Contest

    15 Discussions

    Not sure when the change was made, but with the latest omxplayer, you can now pass the rtmp stream path as a parameter. From the Raspian command line: omxplayer rtmp://ip.address:port/stream-name


    omxplayer rtmp://
    I believe the default rtmp port is 1935.

    1 reply

    I tried this and it does not seem to work for me. I also tried the method recommended in the link and it did not work either.

    I am able to run omxplayer with video files such as:

    omxplayer test01.mpg


    omxplayer FILE2713.MOV

    I use vMix running on a PC to create my streams. I have installed mistserver on my RaspBerry Pi and I am able to view that stream through the mistserver API interface - so I know the vMix can successfully send an rtmp stream to the PI.

    But what I need to do is use the vMix on the PC to create a stream which I can view on the PI's composite video output.

    I keep getting this error:

    Connecting ...

    ERROR: RTMP_Connect0, failed to connect socket. 110 (Connection timed out)


    I have the following version of omxplayer

    bob@Bob-RPI-Ubuntu:~$ omxplayer --version

    omxplayer - Commandline multimedia player for the Raspberry Pi

    Build date: Fri, 23 Sep 2016 00:56:49 +0000

    Version : dfea8c9 [master]


    Hoping for some help with this. Thanks.

    If i want to take a saved video file from raspberry pi and play it live on my PC, how can I do that?

    I am getting

    "Invalid framerate 1000, using forced 25fps and just trust timestamps" then "Have a nice day"

    I'm run following your command but got this error

    ERROR: RTMP_Connect0, failed to connect socket. 111 (Connection refused)

    2 replies

    hi kniac,

    this could probably be because the firewall on your pc is blocking some ports used by RTMP. try turning off the windows firewall and see if it helps.

    I turned off my firewall and tried running it again, but it did not work. I got the same error. Any more advice for this?


    thanks for your guide. I tried with a live stream, it works but omxplayer doesn't show anything in the screen. What I'm missing? I just followed your guide. Cheers

    no. the graphics was separately captured using a video capture card and was overlay-ed during editing.

    Hello, I would Like to know if it possible to do the inverse process. What I mean is if it possible to live stream what you see in th Raspberry PI, if so I also would like to know how to use a Easycap DVR to transmit video from the outputs ( the red, white and yellow wires ) to the Raspberry PI and then to my computer, using your process. Thanks a lot !!


    1 reply

    hi jorgegearvill,

    thanks for your interest. rtmpdump can only be used to read an rtmp stream. What you are trying to achieve may be possible using some other tools, probably gstreamer. give it a try.

    Nice guide! But how command to stream the video?

    Is this correct?

    avconv -re -i -f sap sap://

    (to share a video and not a cam stream)

    1 reply