CYB3RBYTE
Posts: 5
Joined: Fri Jan 25, 2019 3:23 pm

Watching live streams with the Pi, best way to do so?

Fri Jan 25, 2019 3:29 pm

Hello everyone!

I am new to the pi, and I am trying to figure out the best way to watch livestreams (of the monterey bay aquarium) on the pi. I've allocated more GPU memory, am running an official power supply, have heatsinks on, etc. My question is what is the best way to do it? So far I've been running it through chromium but it seems to take up a large amount of CPU power. I installed livestreamer, but it doesn't want to grab the streams and gives me an error.
My network connection is fine, as the streams run well in chromium. Any advice? Thank you!

fruitoftheloom
Posts: 19353
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Watching live streams with the Pi, best way to do so?

Fri Jan 25, 2019 9:12 pm

CYB3RBYTE wrote:
Fri Jan 25, 2019 3:29 pm
Hello everyone!

I am new to the pi, and I am trying to figure out the best way to watch livestreams (of the monterey bay aquarium) on the pi. I've allocated more GPU memory, am running an official power supply, have heatsinks on, etc. My question is what is the best way to do it? So far I've been running it through chromium but it seems to take up a large amount of CPU power. I installed livestreamer, but it doesn't want to grab the streams and gives me an error.
My network connection is fine, as the streams run well in chromium. Any advice? Thank you!

UStream is supported by youtube-dl software ( it supports more than just YouTube )

https://www.ustream.tv/channel/YbUUYwQVQBe (other channels)

https://rg3.github.io/youtube-dl/supportedsites.html


Therefore kweb suite may be of interest as it has built in yt-dl support:

https://www.raspberrypi.org/forums/view ... hp?t=40860
adieu

My other Computer is an Asus CS10 ChromeBit running Chrome Operating System.
HP Envy 4500 Wireless Printer supported by HPLIP software in Raspbian Stretch.

Gadgetguy
Posts: 93
Joined: Fri Aug 15, 2014 2:55 am

Re: Watching live streams with the Pi, best way to do so?

Sat Jan 26, 2019 12:11 am

Streamlink is a fork of livestreamer that unlike livestreamer is maintained and kept up to date. Its' default player is vlc. and the version currently in the raspian repository is hardware accelerated. I just tested your stream with streamlink and it works. Streamlink:

https://github.com/streamlink/streamlink

User avatar
RPi_Mike
Posts: 154
Joined: Sat Dec 09, 2017 12:57 am
Location: United States

Re: Watching live streams with the Pi, best way to do so?

Sat Jan 26, 2019 2:47 am

CYB3RBYTE wrote:
Fri Jan 25, 2019 3:29 pm
I am new to the pi, and I am trying to figure out the best way to watch livestreams (of the monterey bay aquarium) on the pi.

My solution – which uses the extremely potent and well-established tools of FFmpeg, mpv and youtube-dl – does an excellent job at playing live video streams. Unlike the Raspberry's Chromium web browser, it does not exhibit ANY sluggishness or dropped frames whatsoever. In fact, you'll find that even with 1080p live streams, my build of mpv never utilizes more than 5 to 7% of the CPU – a tiny amount that's almost entirely devoted to audio processing. I also wrote a script that builds all the necessary software and sets everything up for you automatically!

Visitors of the Monterey Bay Aquarium website will see that all the embedded videos are delivered via YouTube (a wise choice, given that no self-hosted website could possibly match the reliability of YouTube's vast infrastructure).

I personally tested the video feeds you referenced and verified that my GPU-accelerated build of mpv plays them perfectly.

For example, with my mpv build you would simply run the following command line to watch live video from the "Monterey Bay Cam":

mpv https://www.youtube.com/watch?v=07Yl0-q_ai0

CRITICAL NOTE: Of all the feeds they offer, I chose the above example because it's the only one that broadcasts 24/7. Unfortunately, the source video's encoding quality is quite low. They also might need to clean the sea spray off the lens more often! On top of that, their highest-resolution stream is 720p, not 1080p. The net result of all these external factors is that the video looks a bit blurry and uninspiring. Just wanted to make clear that none of that has anything to do with YouTube or my customized software!


I'LL CLOSE WITH 3 KEY THINGS:

1: Screenshot mosaic of my mpv build streaming at various resolutions (though not shown here, it goes all the way up to 1080p):

Image


2: My tutorial's extremely detailed Appendix 4, which shows how to stream live video with my build of mpv.


3: The Grand Finale: My entire tutorial and script: GIANT UPDATE: Build FFmpeg and mpv – Automatically in 54 Minutes!

CYB3RBYTE
Posts: 5
Joined: Fri Jan 25, 2019 3:23 pm

Re: Watching live streams with the Pi, best way to do so?

Tue Jan 29, 2019 8:46 pm

Mike,

Your attention to detail and solution to this topic is great! I will be installing your solution and reporting back as soon as I get home. Thanks!

User avatar
RPi_Mike
Posts: 154
Joined: Sat Dec 09, 2017 12:57 am
Location: United States

Re: Watching live streams with the Pi, best way to do so?

Wed Jan 30, 2019 3:31 am

CYB3RBYTE wrote:
Tue Jan 29, 2019 8:46 pm
Mike,

Your attention to detail and solution to this topic is great! I will be installing your solution and reporting back as soon as I get home. Thanks!

Excellent!

CYB3RBYTE
Posts: 5
Joined: Fri Jan 25, 2019 3:23 pm

Re: Watching live streams with the Pi, best way to do so?

Wed Jan 30, 2019 3:16 pm

So, I installed the entire script and everything ran as it should, including the animation at the end.

HOWEVER, when I go to terminal and type in mpv followed by that web address, it will either tell me the stream is not availible (which is correct at the time of posting), or it will tell me that I need to include the full youtube.dl header or something.

Any thoughts?

johndavies
Posts: 171
Joined: Fri Dec 20, 2013 1:00 pm

Re: Watching live streams with the Pi, best way to do so?

Wed Jan 30, 2019 5:17 pm

Youtube UrRLs often change. One of the Monterey Bay Aquarium URLs is shown as unavailable; perhaps this is the one that you used. Enter "Monterey Bay Aquarium" into Youtube's Search engine to see if there are any other entries. If you look at Rpi_Mike's explanation of how to download and use a very much improved mpv a], you will see how to use mpv with Youtube. Appendix 4 shows how to watch live news feeds. These often change so if one is unavailable, enter its title into Youtube's Search Engine to find a current one. If you look at page 6, you will see some information which I have added which might be of interest to Australians or people interested in that far away continent. Incidentally the coffin of Matthew Flinders, one of the great European explorers of Australia's coastline has just been discovered by constructors of London's Crossrail project when they found a name plate on it. This cemetery was one of the many unrecorded and forgotten ones which they have cut through.

User avatar
RPi_Mike
Posts: 154
Joined: Sat Dec 09, 2017 12:57 am
Location: United States

Re: Watching live streams with the Pi, best way to do so?

Thu Jan 31, 2019 7:02 am

CYB3RBYTE wrote:
Wed Jan 30, 2019 3:16 pm
So, I installed the entire script and everything ran as it should, including the animation at the end.

HOWEVER, when I go to terminal and type in mpv followed by that web address, it will either tell me the stream is not availible (which is correct at the time of posting), or it will tell me that I need to include the full youtube.dl header or something.

Any thoughts?

Since you saw the "animation" at the very end of my script's execution – the NASA video of colliding neutron stars – that means everything in my script worked perfectly!

However, since a solid understanding of live streams is essential to fully enjoy the many capabilities of my GPU-accelerated software suite, I decided to move this discussion to my tutorial's main thread.

Here's my in-depth response:

https://www.raspberrypi.org/forums/view ... 9#p1423659

CYB3RBYTE
Posts: 5
Joined: Fri Jan 25, 2019 3:23 pm

Re: Watching live streams with the Pi, best way to do so?

Mon Feb 04, 2019 2:58 am

I guess the stream was down when I last tried, as tonight the stream was up and working albeit with only the logo for the aquarium. I've tried other streams (like that of the 24/7 street view of a city square in japan) and it works great! I'm very impressed with this software! I hope you continue to develop it and make more use of the RPi's GPU abilities!

User avatar
RPi_Mike
Posts: 154
Joined: Sat Dec 09, 2017 12:57 am
Location: United States

Re: Watching live streams with the Pi, best way to do so?

Tue Feb 05, 2019 5:37 am

CYB3RBYTE wrote:
Mon Feb 04, 2019 2:58 am
it works great! I'm very impressed with this software! I hope you continue to develop it and make more use of the RPi's GPU abilities!

I'm glad you like my custom-built software suite!

CYB3RBYTE
Posts: 5
Joined: Fri Jan 25, 2019 3:23 pm

Re: Watching live streams with the Pi, best way to do so?

Wed Apr 17, 2019 2:04 pm

So after using this MPV suite for a while, and it working fine for several months now, I am getting a message anytime I try to play something.

[vo/rpi] Could not get DISPMANX objects.
* failed to add service - already in use?

Anyone have some ideas?

Thanks!

User avatar
RPi_Mike
Posts: 154
Joined: Sat Dec 09, 2017 12:57 am
Location: United States

Re: Watching live streams with the Pi, best way to do so?

Wed Apr 17, 2019 5:28 pm

CYB3RBYTE wrote:
Wed Apr 17, 2019 2:04 pm
So after using this MPV suite for a while, and it working fine for several months now, I am getting a message anytime I try to play something.

[vo/rpi] Could not get DISPMANX objects.

Given that error message, the odds are extremely high that you changed the Raspberry's default video driver to the EXPERIMENTAL OpenGL driver known as "Full KMS".

In the requirements section of my tutorial, I explicitly indicated that my GPU-accelerated software suite will NOT work with experimental video drivers.

Be aware that if you switch your Raspberry back to the standard default "legacy" video driver via sudo raspi-config | Advanced Options | GL Driver, there's a bit of a bug in Raspbian that you need to know about:

When the experimental driver is switched on, raspi-config will "secretly" change the /boot/config.txt file back to the 64 MB default setting for the GPU memory allocation without telling you! So if you switch back to the default video driver to get things working, be sure to reset the GPU memory to 128 MB as my tutorial requires – because if you don't do that, you'll be treated to a whole new batch of error messages that also have nothing to do with my software suite!

Raspberry users love to experiment and "tinker" with their systems in unknowable and unpredictable ways — which is why I only "support" a completely standard, "normal" copy of Raspbian. As far as I'm concerned, once the system has been altered, it's no longer Raspbian — it's a different system called Altered Raspbian!

For more on this perspective, please see my "Philosophical Note" at the bottom of this post (it's marked in red):

viewtopic.php?f=38&t=228095&p=1443694#p1437891

Return to “Graphics, sound and multimedia”