Page 1 of 1

Probably the strangest ever request

Posted: Tue Jan 28, 2020 7:19 pm
by colin_b
I've got a problem which is driving me nuts. I am hoping MX devs can give some info, and maybe be of assistance.

It started about three weeks ago when I read the article "The internet’s YouTube habit has the carbon footprint of a small city."

The following stuck in my head after reading it:
One common practice for users is to play a YouTube video just to access its audio. In their paper, which was presented at the annual ACM Computer-Human Interaction conference this week, the researchers show that YouTube’s carbon footprint could be meaningfully reduced if the company were to design a feature that would stop playing videos if they’re running in a browser tab that a user isn’t actively watching. If 25% of music videos are played in the background of a user’s browser, then YouTube could save 323,000 tons of carbon dioxide equivalent. This conservative estimate saves about 3% of the total annual greenhouse gas emissions associated with watching videos, and is about the same as the carbon footprint of 50,000 cars over the course of a year.
About a week later I saw David Attenborough saying the the world was going to end if carbon emissions aren't reduced.

I got to thinking about the above article and wondered if was a simple way to reduce the carbon emissions of YouTube. So I thought about it, and then thought about it some more :hmm: . Then a light-bulb pinged on above my head - I believe it can be easily achieved.

I contacted the professor in the article and forwarded him the solution I have come up with. I have called it "conservative buffering", and the following is how I described it in the email to the professor:
The following will allow YouTube to continue audio playback but stop downloading video when a different tab is selected:

[Note: the two second duration is a suggestion, not an absolute]

1a) When play is pressed audio and video data required for the first two seconds of playback are downloaded. When this data is downloaded the files are output.

1b) Whilst the initial two seconds of data is being output the next two seconds of A/V data is downloaded.

1c) When the output of the initial two seconds has completed the next two seconds of A/V data are output.

1d) Whilst this data is output the next two seconds of A/V data is downloaded.

1e) When the two second data output is completed the following two seconds of A/V data are output.

Repeat steps 1d and 1e whilst the browser tab showing the video is selected.

When a different browser tab is selected:

2a) Whilst the previous two seconds of data is being output the audio (and only the audio) for the next two seconds is downloaded.

2b) When the previous two seconds of data have completed output the two seconds of audio is output.

2c) Whilst this data is output the next two seconds of audio data is downloaded.

2d) When the two second data output is completed the following two seconds of audio data is output.

Repeat steps 2c and 2d whilst the video output tab is not selected.

When the video output tab is re-selected go back to step 1d.

Repeat until video output is complete.

This output method also reduces wasted data. If I stop a YouTube video that has been playing conventionally for a while then its 120 second buffer serves no purpose. If the same video is played with a conservative buffer of 2 seconds then the amount of wasted data will be no more than 4 seconds.

The entire resultant is a significant chunk off of YouTube's carbon footprint.
I have had no reply to the email, and I'm left scratching my head. I know my description isn't perfect, but the concept is easily grasped when it is given a bit of thought.

Will the above work?

If it will could someone find the time to modify mpv or Mplayer to use conservative buffering? When the player is maximized the audio and video is downloaded and output. When the player is minimized only the audio is downloaded and output.

Not only will it reduce the carbon footprint of YouTube, it will also benefit people like myself who have limited bandwidth (eg - podcasts can be played with the player minimized to reduce the bandwidth used).

I told you it was a strange request :biggrin: .

Re: Probably the strangest ever request

Posted: Tue Jan 28, 2020 7:36 pm
by Fibogacci
You know, the solution is/could be simple - listen just audio if you don't need (any) video.

I am such a person, which often don't need video.

And it's easy with Linux and eg. mpsyt (mps-youtube) in terminal.

And also it could be a solution for listening YouTube music on your smartphone with Android (and Linux installed on it) - screen can be turned off.

With default YouTube application for Android screen is always on (if you don't use Premium YT music service).

I suppose smartphones' screens use most of battery life.

My way of listening to YouTube on smartphone (and it's not only music, but more often some educational videos/lectures and other similar stuff): https://lbry.tv/@Dude:7/youtube-on-andr ... ter-better

Re: Probably the strangest ever request

Posted: Wed Jan 29, 2020 2:38 am
by sunrat
If I want to listen to audio from Youtube more than once I just download it locally. No more wasted electricity and carbon emissions from those hungry servers, and it's easier to find when I want to play it.

Code: Select all

youtube-dl --extract-audio <url of video>
And I sadly predict the world will be fairly unliveable in 30-50 years anyway. We may not have reached the point of no return with climate change yet, but the people who could actually do the most to slow/stop it are dragging their heels.

Re: Probably the strangest ever request

Posted: Wed Jan 29, 2020 2:46 am
by oops
Fibogacci wrote: Tue Jan 28, 2020 7:36 pm You know, the solution is/could be simple - listen just audio if you don't need (any) video.
...
Right, it's an efficient idea. I do not like videos, except sometimes.

Re: Probably the strangest ever request

Posted: Wed Jan 29, 2020 2:54 am
by freemedia2018
Fibogacci wrote: Tue Jan 28, 2020 7:36 pm You know, the solution is/could be simple - listen just audio if you don't need (any) video.
most people are not going to use that solution, so it is relevant from a theoretical and practical standpoint, but not in terms of reducing overall energy usage.

if most of the energy usage comes from people who use the website, then the solution will probably need to be applied to the website. of course i welcome command-line solutions, im a fan of those myself. and there are a lot of us. but for the purpose of reducing overall energy waste, there arent enough of us for that (compared to those who would benefit from a website design tweak.)

this should definitely be proposed to the makers of peertube and invidio.us though.

both projects are free software and people could be encouraged to use those-- not as many as would benefit from google changing youtube, but likely more than would benefit from a command line tool.

Re: Probably the strangest ever request

Posted: Wed Jan 29, 2020 7:11 am
by Fibogacci
freemedia2018 wrote: Wed Jan 29, 2020 2:54 am
Fibogacci wrote: Tue Jan 28, 2020 7:36 pm You know, the solution is/could be simple - listen just audio if you don't need (any) video.
most people are not going to use that solution, so it is relevant from a theoretical and practical standpoint, but not in terms of reducing overall energy usage.
That's the point. Good/optimal solutions are often not (too) popular (it is not easy to change an old habit). The same is with healthy lifestyle, way of doing things and so on.

Well, mpsyt is CLI, but someone could make a nice GUI - if there is no such a thing already, I don't know ;)

Re: Probably the strangest ever request

Posted: Wed Jan 29, 2020 8:26 am
by PPC
There's a GUI version for listening to YouTube videos already available: smtube - click the video you want - and select the option to listen to audio with - vlc ...

Re: Probably the strangest ever request

Posted: Wed Jan 29, 2020 8:36 am
by KoO
Well, mpsyt is CLI, but someone could make a nice GUI - if there is no such a thing already, I don't know = GUI is bloat and has a bad carbon foot print = cli saves penguins from floating Icebergs. :alien:

Re: Probably the strangest ever request

Posted: Wed Jan 29, 2020 1:11 pm
by freemedia2018
KoO wrote: Wed Jan 29, 2020 8:36 am GUI is bloat and has a bad carbon foot print
oh i dont know, i have a cpu monitor running all the time and youll probably save more energy booting to ram than you will avoiding the gui.

even if you run vt-only, youre running a framebuffer. a modest toolkit and a similar window manager isnt costly in terms of ram or cpu. youre already running the backlight which uses a lot more energy. unless youre using a big fancy desktop environment-- that really is bloat. high-resolution video and a "gui" of some sort-- really not the same thing in terms of battery/ac-sucking resources. what this thread needs is stats; if that.

Re: Probably the strangest ever request

Posted: Wed Jan 29, 2020 2:15 pm
by oops
freemedia2018 wrote: Wed Jan 29, 2020 1:11 pm
KoO wrote: Wed Jan 29, 2020 8:36 am GUI is bloat and has a bad carbon foot print
oh i dont know, i have a cpu monitor running all the time and youll probably save more energy booting to ram than you will avoiding the gui.
...
The foot print is not only on your computer, but also in the network and the net server.

Re: Probably the strangest ever request

Posted: Thu Jan 30, 2020 6:16 am
by freemedia2018
oops wrote: Wed Jan 29, 2020 2:15 pmThe foot print is not only on your computer, but also in the network and the net server.
over a vpn, sure. but the only gui i was talking about was the local one used to run an application that isnt on the command line, which skips the video portion of youtube and only streams/downloads the audio.

Re: Probably the strangest ever request

Posted: Thu Jan 30, 2020 6:46 pm
by colin_b
Thanks for your replies. My apologies for the delayed reply but my mum passed away yesterday.

The reason I made my initial post is because I know the community and devs of MX are creative and knowledgeable. All I really want to know is can YouTube data be streamed in the manner detailed in my original post? If it can would it take a lot of work to create a player which utilizes this concept to play YouTube videos?

The reason I see it as useful is it requires no user interaction. A maximized video downloads and plays the audio and video, and a minimized window only downloads and plays the audio, thus saving bandwidth.

If it can be easily done then a working player could be a big feather in the cap of MX Linux - you could have the tagline "MX Linux, the distro that taught Google how to be more eco-friendly." :happy:

Re: Probably the strangest ever request

Posted: Thu Jan 30, 2020 8:25 pm
by turtlebay777
colin_b wrote: Tue Jan 28, 2020 7:19 pm I've got a problem which is driving me nuts. I am hoping MX devs can give some info, and maybe be of assistance.

It started about three weeks ago when I read the article "The internet’s YouTube habit has the carbon footprint of a small city."

About a week later I saw David Attenborough saying the the world was going to end if carbon emissions aren't reduced.



I told you it was a strange request :biggrin: .
Guess you haven't read this report by the Club of Rome from 1970 where they admit to starting a false project about Global Warming.
Read it and weep. Even that schoolgirl Greta has been fooled by the world's richest multi-billionaires. I mean who could turn down a plea by a school girl?
I wonder how much they paid David Attenborough to parrot their poisonous spiel?
https://www.clubofrome.org/report/the-limits-to-growth/
PDF download here: http://www.donellameadows.org/wp-conten ... ersion.pdf

BTW I have scientific friends who have posted actual climate results which show global temperatures remain the same or are actually cooling.

Re: Probably the strangest ever request

Posted: Thu Jan 30, 2020 10:01 pm
by SwampRabbit
colin_b wrote: Thu Jan 30, 2020 6:46 pm Thanks for your replies. My apologies for the delayed reply but my mum passed away yesterday.
Holy cow, sorry for you loss.

Don't worry about saving the planet right now, spend time with family and friends.

Re: Probably the strangest ever request

Posted: Thu Jan 30, 2020 10:18 pm
by figueroa
Computed savings are completely theoretical. Can't be bankrolled.

Re: Probably the strangest ever request

Posted: Thu Jan 30, 2020 11:16 pm
by colin_b
Thanks for your thoughts SwampRabbit & ForWIW.

The only reason I've come back to this thread at this time is I mentioned what I'd come up with to my mum a few weeks ago, but I got a blank stare because she knew nothing about computers.

I'm no eco-warrior trying to save the planet. I can see is that what I've come up with has the potential to reduce YouTube traffic. If it is used by enough people then the internet might get a little bit faster and more reliable for everyone. The side-benefit is reduced CO2 emissions.

I would just like to know if it is achievable. If it is then I will tell mum on my last visit to her in a few days. Hopefully she will be looking down and realize I'm not as mad as a box of frogs.

Re: Probably the strangest ever request

Posted: Fri Jan 31, 2020 5:22 am
by freemedia2018
i think its a good idea colin, im sure its doable if enough people are interested.

if one program can do it at all, an application to do it better is typically possible from there. but it takes building up a certain amount of momentum and interest.

or sometimes someone just comes up with a tool for it. that also happens.