loading
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. http://www.youtube.com/watch?v=HXA_w8Hkjeo
<p>Not sure when the change was made, but with the latest <em>omxplayer, </em>you can now pass the rtmp stream path as a parameter. From the Raspian command line: omxplayer rtmp://ip.address:port/stream-name</p><p>Example:</p><p><strong>omxplayer rtmp://10.11.123.100:1935/live/mystream</strong><br>I believe the default rtmp port is 1935.</p>
<p>I tried this and it does not seem to work for me. I also tried the method recommended in the link <a href="http://www.youtube.com/watch?v=HXA_w8Hkjeo" rel="nofollow">http://www.youtube.com/watch?v=HXA_w8Hkjeo</a> and it did not work either.</p><p>I am able to run omxplayer with video files such as:</p><p>omxplayer test01.mpg</p><p>or</p><p>omxplayer FILE2713.MOV</p><p>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.</p><p>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.</p><p>I keep getting this error:</p><p>Connecting ...</p><p>ERROR: RTMP_Connect0, failed to connect socket. 110 (Connection timed out)</p><p>bob@Bob-RPI-Ubuntu:~$</p><p>I have the following version of omxplayer</p><p>bob@Bob-RPI-Ubuntu:~$ omxplayer --version</p><p>omxplayer - Commandline multimedia player for the Raspberry Pi</p><p> Build date: Fri, 23 Sep 2016 00:56:49 +0000</p><p> Version : dfea8c9 [master]</p><p> Repository: <a href="https://github.com/popcornmix/omxplayer.git" rel="nofollow"> https://github.com/popcornmix/omxplayer.git</a></p><p>Hoping for some help with this. Thanks.</p>
<p>Hello,<br>If i want to take a saved video file from raspberry pi and play it live on my PC, how can I do that?</p>
<p>I am getting </p><p>&quot;Invalid framerate 1000, using forced 25fps and just trust timestamps&quot; then &quot;Have a nice day&quot; </p>
<p>I'm run following your command but got this error</p><p>ERROR: RTMP_Connect0, failed to connect socket. 111 (Connection refused)</p>
<p>hi kniac,</p><p>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.</p>
<p>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?</p>
<p>Worth reading</p>
<p>Hi,</p><p>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</p>
<p>how do you show graphics from the command prompt? is this using xfb? </p>
<p>no. the graphics was separately captured using a video capture card and was overlay-ed during editing.</p>
<p>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 !! </p><p>SOMETHING LIE THIS WOULD BE WONDERFUL http://www.raspberrypi.org/forums/viewtopic.php?t=45682&amp;p=361303</p>
<p>hi jorgegearvill,</p><p>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.</p>
<p>Nice guide! But how command to stream the video? </p><p>Is this correct?</p><p>avconv -re -i video.mov -f sap sap://224.1.1.1:1234?same_port=1</p><p>(to share a video and not a cam stream)</p>
I think that would work.

About This Instructable

35,865views

38favorites

License:

Bio: Engineer. Educator. Entrepreneur.
More by nprasan:Generating Lissajous Figures using a PC/Laptop Sound Card Use your Windows Phone device as a Wireless Microphone Use your smartphone mic with your PC 
Add instructable to: