News for hackers. Stuff that matters.
Re:Firefox 70 by danlugo92 on Tuesday October 22, 2019 @10:37AM (#21324072)
Would this bring it up to par with safari's power consumption?
Re:Firefox 70 by fpgaminer on Tuesday October 22, 2019 @11:09AM (#21324480)
I don't know about other usages, but energy consumption while using YouTube is important to me (usually have something playing while I work) so I just did a quick measurement.

Safari 13.0.2 versus Firefox 70.0 versus Chrome 77.0

Playing the same YouTube video at the same quality (1080p) and watching Energy Impact in Activity Monitor while the video played, I saw averages of: Safari used 20, Firefox used 45, Chrome used 45.

So on that task at least Safari is still king, but Firefox is on par with Chrome.

Re:Firefox 70 by rsynnott on Tuesday October 22, 2019 @11:53AM (#21325104)
You could try a plugin which forces h264 Youtube. Just about anything made in the last decade has mature hardware support for decoding h264, but not necessarily for VP8/9. This may be what's going on here.
Re:Firefox 70 by nathancahill on Tuesday October 22, 2019 @12:25PM (#21325537)
Re:Firefox 70 by bkor on Wednesday October 23, 2019 @05:42AM (#21332896)
See https://mozillagfx.wordpress.com/2019/10/22/dramatically-red...

More work is planned to reduce the energy usage for scrolling and full screen video. Though I guess for your example you don't watch things fullscreen.

Re:Firefox 70 by bluegreyred on Tuesday October 22, 2019 @11:18AM (#21324601)
I just checked with the Intel Power Gadget on a 2015 MBP 10.14.6, iGPU only, same video at 1080p, package power consumption (CPU + iGPU):

~6,4W average in Safari 13.0.3

~8,6W average in Firefox 70

Re:Firefox 70 by pier25 on Tuesday October 22, 2019 @11:17AM (#21324592)
Safari still uses significantly less CPU while decoding video.
Re:Firefox 70 by padenot on Tuesday October 22, 2019 @11:55AM (#21325132)
Safari does not support vp8 or vp9 when playing youtube, and youtube serves h264 instead. h264 is less efficient in terms of compression ratio (more to download for the same quality), but h264 is decoded in hardware on OSX, and VP8 or VP9 isn't, which explains what you see.

This is why, for example, Safari does not have 4k video on Youtube, while being perfectly capable of playing 4k videos in general.

Depending on the machine, VP9 can be decoded in hardware on Firefox on Windows, but chip support is limited.

All that said, we're working on our video playback performance as we speak, especially on OSX (because it was so bad a few release back), but also in general.

Re:Firefox 70 by pier25 on Tuesday October 22, 2019 @02:03PM (#21326781)
Thanks for the explanation.

I found this extension that forces FF to use H264 instead: https://addons.mozilla.org/en-US/firefox/addon/h264ify/

On my old MBP I'd rather consume more bandwidth than more more CPU.

Re:Firefox 70 by kzrdude on Wednesday October 23, 2019 @02:50AM (#21331811)
Thanks for the link. On Firefox/Linux nvidia drivers, I don't see much difference in h264 vs VP9
Re:Firefox 70 by padenot on Wednesday October 23, 2019 @08:11AM (#21333724)
We don't do hardware decoding on Linux for now, because we don't do hardware acceleration for graphics by default on Linux.

Web Render might allow doing it properly, since the rendering is not on the CPU anymore.

Re:Firefox 70 by bhj on Tuesday October 22, 2019 @11:46AM (#21325003)
Also from the Q&A at the end:

> Safari’s compositor is entirely Core Animation based; Safari basically skips step 2.

(Step 2 is "the Firefox “compositor” assembles Gecko layers to produce the rendering of the window")

Re:Firefox 70 by pier25 on Tuesday October 22, 2019 @11:50AM (#21325068)
You think this affects video decoding?

Anyway, I imagine that's the price to pay for being crossplatform. You can't implement everything for every platform. Safari only has to work on macOS/iOS.

Re:Firefox 70 by rwxsh on Tuesday October 22, 2019 @05:50PM (#21328816)
> You think this affects video decoding?

Speaking for Chrome's implementation, efficiently rendering video on macOS does require CALayer compositing, but it's not sufficient.

Only certain types of decoded frames can be efficiently scanned out (different from the types that can be used efficiently in OpenGL compositing). Actually entering the most efficient fullscreen video mode requires some magic. Matching macOS behavior exactly when a fallback to OpenGL compositing is required can be difficult (eg. colorspace bugs can result in flickering).

I have not looked at the new code in Firefox, but I would expect that not all of the benefit would be realized in a first release. In any case it's a huge undertaking to support a single platform; congrats to the team for making it happen!

Re:Firefox 70 by Angeo34 on Tuesday October 22, 2019 @10:31PM (#21330516)
Maybe just don't watch videos inside your Browser. You know there's youtube-dl+mpv?
Re:Firefox 70 by w1nst0nsm1th on Wednesday October 23, 2019 @01:41AM (#21331430)
iina can ply youtube stream without pre-downloading them. You have also Picture in Picture following you on all desktop.

iina is open source and have a lot of codec available.

I don't know if it change something on energy consumption, though.

Re:Firefox 70 by helb on Wednesday October 23, 2019 @04:03AM (#21332288)
I don't know what iina is, but youtube-dl + mpv mentioned by Angeo34 does exactly that (stream videos without pre-downloading them). Youtube-dl just gets the stream URL and mpv plays it. And it's easy to use, just:

    mpv https://www.youtube.com/watch?v=oHg5SJYRHA0