How to play TV web streaming?


11 posts
by raspi-config » Sun Apr 14, 2013 5:31 am
Hi everybody,

The last 3 days I've been trying to play an specific TV streaming channel. I've got it working on the RPi, but it is really very slow and uses almost 100% of the CPU.
The channel I've been trying to play is this one: http://play2go.tv/live/flowplayer.html? ... Vnovotempo

As far is I know, they only transmit their streaming in rtmp. So, I installed rtmpdump and mplayer. I've been using the following command:

Code: Select all
rtmpdump -v -r rtmp://play2go.tv:1935/live -y TVnovotempo -W http://play2go.tv/flowplayer/flowplayer.commercial-3.2.14.swf -p http://play2go.tv/live/flowplayer.html | mplayer -



But even if I try the "-framedrop" option or "-autosync 30" it continues very slow and uses a lot of CPU. I also tried to use "omxplayer", once it uses GPU acceleration, but I got no sucess. The command I used was:

Code: Select all
omxplayer rtmp://play2go.tv:1935/live




Can you guys help me to play this? I would rather to use omxplayer because of its GPU acceleration, but I can use any other programs that you recommend and that plays the streaming properly (without crashes and slow video).

Thank you very much!
User avatar
Posts: 20
Joined: Mon Dec 24, 2012 5:46 pm
by raspi-config » Mon Apr 15, 2013 12:09 am
Please, I need your help! :cry:
User avatar
Posts: 20
Joined: Mon Dec 24, 2012 5:46 pm
by ghans » Mon Apr 15, 2013 6:34 am
Your problem could be solved in a similiar way as
explained in this thread :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=63&t=33473

Named pipes should be very useful for this , you should look
them up.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
Posts: 4612
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany
by raspi-config » Mon Apr 15, 2013 1:50 pm
Hello ghans,

I'm not expert in Linux, but I read the whole thread and I tried this command:

Code: Select all
mkfifo stream


Then i ran:

Code: Select all
rtmpdump -v -r rtmp://play2go.tv:1935/live -y TVnovotempo -W http://play2go.tv/flowplayer/flowplayer.commercial-3.2.14.swf -p http://play2go.tv/live/flowplayer.html | mplayer - -dumpstream -dumpfile stream & omxplayer -r stream


I got the following error (I copied everything, sorry if it is too big):

Code: Select all
RTMPDump v2.4
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
WARNING: You haven't specified an output file (-o filename), using stdout
Connecting ...
INFO: Connected...
MPlayer svn r34540 (Debian), built with gcc-4.6 (C) 2000-2012 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing -.
Reading from stdin...
Starting Live Stream
INFO: Metadata:
INFO:   author
INFO:   copyright
INFO:   description
INFO:   keywords
INFO:   rating
INFO:   title
INFO:   presetname            Custom
INFO:   creationdate          Sun Apr 14 21:22:46 2013
INFO:   videodevice           Osprey-210 Video Device 1
INFO:   framerate             30.00
INFO:   width                 480.00
INFO:   height                360.00
INFO:   videocodecid          avc1
INFO:   videodatarate         500.00
INFO:   avclevel              30.00
INFO:   avcprofile            77.00
INFO:   videokeyframe_frequency4.00
INFO:   audiodevice           Osprey-210 Audio Device 1
INFO:   audiosamplerate       44100.00
INFO:   audiochannels         2.00
INFO:   audioinputvolume      75.00
INFO:   audiocodecid          mp4a
INFO:   audiodatarate         48.00
126.756 kB / 3.42 secfile : stream result 120 format flv audio streams 1 video streams 1 chapters 0 subtitles 0 length 1511828
/usr/bin/omxplayer.bin: symbol lookup error: /usr/bin/omxplayer.bin: undefined symbol: vc_tv_get_display_state
157.578 kB / 3.90 secdump: 163840 bytes written


MPlayer interrupted by signal 13 in module: dumpstream
stream: Error writing file.

Exiting... (Fatal error)

Caught signal: 13, cleaning up, just a second...
ERROR: Download: Failed writing, exiting!
User avatar
Posts: 20
Joined: Mon Dec 24, 2012 5:46 pm
by raspi-config » Tue Apr 16, 2013 4:43 am
Anyone there?
User avatar
Posts: 20
Joined: Mon Dec 24, 2012 5:46 pm
by ghans » Tue Apr 16, 2013 12:29 pm
Looking at it, Flash video can be anything from Sorenson
over VP6 to h.264.
Only the latter can be played any faster at all (via
omxplayer). Are you sure that your stream is h.264 ?
If yes , try to omit mplayer completely and have
rtmpdump and omxplayer do the work.


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
Posts: 4612
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany
by raspi-config » Tue Apr 16, 2013 1:16 pm
I'm not sure if the streaming is h264. It seems to be.

ghans wrote:If yes , try to omit mplayer completely and have
rtmpdump and omxplayer do the work.


edit: I got the following error when I try that:


Code: Select all
file : stream result 124 format flv audio streams 1 video streams 1 chapters 0 subtitles 0 length 1511828
/usr/bin/omxplayer.bin: symbol lookup error: /usr/bin/omxplayer.bin: undefined symbol: vc_tv_get_display_state
User avatar
Posts: 20
Joined: Mon Dec 24, 2012 5:46 pm
by ghans » Tue Apr 16, 2013 5:17 pm
Code: Select all
mkfifo /tmp/streamtest.flv
rtmpdump -v -r rtmp://play2go.tv:1935/live -y TVnovotempo -W http://play2go.tv/flowplayer/flowplayer.commercial-3.2.14.swf -p http://play2go.tv/live/flowplayer.html > /tmp/streamtest.flv
omxplayer /tmp/streamtest.flv


does NOT work ?

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
Posts: 4612
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany
by raspi-config » Tue Apr 16, 2013 5:23 pm
I finally got this working!!!!!
It was necessary to apt-get upgrade with the 07/fev version!

Now i have only 1 question: as I told you I'm "new" to Linux. I'm using a mkfifo file to make rtmpdump work with omxplayer. I wish to know if all data stay only in RAM memory and there is no risk to decrease the lifespan of my memory card (because flash cards have limited number of writing operations).


Thank you very much for your help ghans!
User avatar
Posts: 20
Joined: Mon Dec 24, 2012 5:46 pm
by ghans » Sat Apr 20, 2013 8:35 am
No idea.
tmpfs can swap to disk IIRC.

Try
Code: Select all
df -h

and see if anything changes over time.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
Posts: 4612
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany
by RSFalcon7 » Thu May 09, 2013 6:29 am
@raspi-config, can you post your final command/script?
I would be very useful to me.

Also, since your example was about TVNovoTempo, did you tried with the radio too?
http://play2go.tv/radio/radio.html?stream=RADIOpt

Thanks a lot in advance
User avatar
Posts: 1
Joined: Thu May 09, 2013 6:24 am