Closed Bug 1163327 Opened 9 years ago Closed 2 years ago

Youtube HTML5 high CPU load

Categories

(Core :: Audio/Video: Playback, defect, P2)

37 Branch
Unspecified
Windows 7
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: andypublic, Unassigned)

References

Details

(Whiteboard: [platform-rel-Youtube])

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0
Build ID: 20150415140819

Steps to reproduce:

Went to youtube.com, played a video.


Actual results:

When I play a HTML5 video on youtube the CPU load goes up to 60-70% and when I pause or exit the video it goes back down to normal load.


Expected results:

CPU shouldn't have loaded more than 15%
I second that. It happens when playing videos in 720p or 1080p in 60fps.

To reproduce just play a video in 720p or 1080p and monitor the CPU. Then pause it and watch the CPU usage go down.
I can confirm that I am also experiencing this bug as well, tested using a laptop with a pentium dual core @ 2.16ghz. I use a somewhat old computer for my online browsing activities.

I use Firefox 38.0.5.

While watching a YouTube video on the HTML5 player at the 480p setting, which is the setting that I normally use on YouTube, the CPU usage would just behave strange. The CPU usage would just skyrocket immediately to 50%-60% and then it would eventually just stay at 100% CPU usage until I pause the video that I am currently watching with the YouTube HTML5 player.

Taking a look at the Windows Task Manager while this is happening, Firefox's process, firefox.exe, is just hogging up the CPU as I mentioned what was happening above.

I do realize however that native YouTube HTML5 support in Mozilla Firefox is in an early stage, as I would like to call it that way, as it was released as of Firefox 37. Hopefully this bug problem can be resolved in someway or another. Hopefully.
Upgrading to Firefox 41 doesn't solve the issue, in fact now it's worse, even 360p/480p videos tend to use more CPU... It's weird that Firefox tends to use more CPU than GPU for this tasks...

My Specs:

CPU: AMD Athlon X2 QL-65 64 bit CPU @ 2.1 Ghz
RAM: 4 GB
VGA: ATI Radeon HD 3200 with 2012 drivers (8.961.0.0)
HDD: Seagate Momentus 7200.4 7200 RPM 500 GB

Firefox Support Page info:
------------
Configuración básica de la aplicación
-------------------------------------

Nombre: Firefox
Versión: 41.0
Id. de compilación: 20150917150946
Canal de actualizaciones: release
Agente de usuario: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0
Ventanas multiproceso: 0/1 (por defecto: false)

Informe de fallos de los últimos 3 días
---------------------------------------

Todos los informes de fallos

Extensiones
-----------

Nombre: Saved password editor (Editor de contraseñas)
Versión: 2.9.2
Activada: true
ID: savedpasswordeditor@daniel.dawson

Nombre: uBlock Origin
Versión: 1.1.1
Activada: true
ID: uBlock0@raymondhill.net

Gráficas
--------

Adaptador de la RAM: 256
Controladores del Adaptador: aticfx64 aticfx64 aticfx32 aticfx32 atiumd64 atidxx64 atiumdag atidxx32 atiumdva atiumd6a atitmm64
Descripción de Adaptador: ATI Radeon HD 3200 Graphics
Direct2D Habilitado: true
DirectWrite Habilitado: true (6.2.9200.16492)
Encuadro/zoom asíncrono: ninguno
Fecha del dispositivo: 4-5-2012
GPU #2 Activa: false
GPU acelerada de Windows: 1/1 Direct3D 11 (OMTC)
ID de Vendor: 0x1002
ID del dispositivo: 0x9612
ID del subsys: 021b1025
Procesador WebGL: Google Inc. -- ANGLE (ATI Radeon HD 3200 Graphics Direct3D11 vs_4_0 ps_4_0)
Soporta Decodificación de Hardware H264: false
Versión del dispositivo: 8.961.0.0
windowLayerManagerRemote: true
AzureCanvasBackend: direct2d 1.1
AzureContentBackend: direct2d 1.1
AzureFallbackCanvasBackend: cairo
AzureSkiaAccelerated: 0
(#0) Error: [D2D1.1] 4CreateBitmap failure Size(16,12834) Code: 0x80070057
(#1) Error: [D2D1.1] 4CreateBitmap failure Size(16,12834) Code: 0x80070057

Preferencias importantes modificadas
------------------------------------

browser.cache.disk.capacity: 358400
browser.cache.disk.filesystem_reported: 1
browser.cache.disk.smart_size.first_run: false
browser.cache.disk.smart_size.use_old_max: false
browser.cache.frecency_experiment: 3
browser.download.importedFromSqlite: true
browser.places.smartBookmarksVersion: 7
browser.sessionstore.upgradeBackup.latestBuildID: 20150917150946
browser.startup.homepage: about:newtab
browser.startup.homepage_override.buildID: 20150917150946
browser.startup.homepage_override.mstone: 41.0
dom.apps.reset-permissions: true
dom.mozApps.used: true
extensions.lastAppVersion: 41.0
gfx.direct3d.last_used_feature_level_idx: 1
gfx.driver-init.appVersion: 41.0
gfx.driver-init.deviceID: 0x9612
gfx.driver-init.driverVersion: 8.961.0.0
gfx.driver-init.feature-d2d: true
gfx.driver-init.feature-d3d11: true
gfx.driver-init.status: 2
media.gmp-eme-adobe.lastUpdate: 1443152258
media.gmp-eme-adobe.version: 13
media.gmp-gmpopenh264.lastUpdate: 1443152259
media.gmp-gmpopenh264.version: 1.4
media.gmp-manager.buildID: 20150917150946
media.gmp-manager.lastCheck: 1443152253
media.hardware-video-decoding.failed: true
network.cookie.prefsMigrated: true
network.http.speculative-parallel-limit: 0
network.predictor.cleaned-up: true
network.prefetch-next: false
places.history.expiration.transient_current_max_pages: 100622
plugin.disable_full_page_plugin_for_types: application/pdf
plugin.importedState: true
privacy.cpd.offlineApps: true
privacy.cpd.siteSettings: true
privacy.donottrackheader.enabled: true
privacy.sanitize.migrateFx3Prefs: true
privacy.sanitize.timeSpan: 0
privacy.trackingprotection.enabled: true

Preferencias importantes bloqueadas
-----------------------------------

JavaScript
----------

Recogida de basura incremental: true

Accesibilidad
-------------

Activado: false
Prevenir accesibilidad: 0

Versiones de bibliotecas
------------------------

NSPR
Versión mínima esperada: 4.10.8
Versión en uso: 4.10.8

NSS
Versión mínima esperada: 3.19.2 Basic ECC
Versión en uso: 3.19.2 Basic ECC

NSSSMIME
Versión mínima esperada: 3.19.2 Basic ECC
Versión en uso: 3.19.2 Basic ECC

NSSSSL
Versión mínima esperada: 3.19.2 Basic ECC
Versión en uso: 3.19.2 Basic ECC

NSSUTIL
Versión mínima esperada: 3.19.2
Versión en uso: 3.19.2

Características experimentales
------------------------------

This is the funny stuff... if you try to play HD/60fps stuff, Firefox tends to use the CPU INSTEAD of the GPU (100% load CPU vs 30%-35% GPU) It's supposed that Firefox uses the GPU for hardware acceleration since is faster...

This used to work well on 40.0.3 if you disabled flash and prevented it from loading in Youtube, or just closing and relaunching the browser, then you got a normal 65%-70% CPU and 80%-85% of GPU load (totally spected), but then, you you change to another video, it reverts back to 100% CPU. In FF41 it stays at 100% and almost no GPU usage.

I think the reason for this is (doh!) that Firefox has problems taking the GPU as exclusive for this kind of stuff, or at least, allocating enough resources from it to work. I know this because I've tested using the Task Manager and GPU-Z at the same time, so I came to this conclusion.

Funny that things that Photoshop CS6 x64 don't give me this problems, while FF still struggles to work well with HTML5 videos... Hardware Acceleration is still in diappers I see XD
ust for the record, I found this thread in a forum that talks about h264 (that I assume, Firefox is using for Youtube content) and VP9 (Which is not enabled by default)

https://forums.comodo.com/general-discussion-off-topic-anything-and-everything/open-h264-video-codec-and-firefox-t107855.0.html

It's old, but they talk about an old library (libvpx.dll) for the VP9 support, they say FF uses 1.3.0 version, while Chrome goes for a newer and faster version... Can this explan somehow why the FF is slow with HD/60 content and why the about:support page says that h264 decoding is not supported by my VGA, while I can play that kind of videos locally with Windows Media Player and VLC with no issues?

Funny and interestring... My desktop with a ATI Radeon HD 4350 with 2010 drivers doesn't exhibit this issue...

Seems you got either old libraries bloating FF or just a bug with ths particular version or FF...
Ok, I discovered what the hell happened here... by some unknown reason, Firefox 41 disabled hardware accelerated h264 decodinf for me, while my VGA clearly supports it... so if you know your VGA supports DXVA 2.0 (required for this to work) just change this setting on FF41:

media.hardware-video-decoding.failed

If this little fella says true, change it to false then your video playback will be normal with h264, including HD/60 fps and Full HD/60 fps

I've checked with my desktop, and this setting says false, why is my laptop's VGA "blacklisted" while the desktop's one, that got older drivers, is not?
I have the same problem so I will not create a new bug.
On Linux platform.
With Seamonkey 2.38 (the first version viewing youtube videos in html5 by default ?).
With Firefox 41.0.2.

It works but with a so high CPU usage... It's worse than flash !
windows 8.1 64x, firefox 42

I double that. The bug is real. Also, for me, it affects ONLY Youtube. Other html5 videos, at least the ones I've seen, played on no more than 15% CPU load.

Load of my intel 2500k can be up to 80% on 1080 60fps youtube video.
 
I've tried Safe Mode, it didn't help. I tried the older version of Firefox (38) and it works like a charm. So, apparently, development team broke something along the way. Please fix.
Windows 7 x64, Firefox 42

Same problem here. In fact, it's probably worse! I just can't load http://www.youtube.com/feed/subscriptions without having 10-15% CPU usage on my Core i7 950 CPU, 6GB of RAM, etc. 10-15% is equivalent to a whole CPU Core of 8 (4 core * 2 threads). Just watching a video in 720 and 1080p is fine but if you pause and start to go and use anything flash or HTML5 based such as Twitch, everything will stutter. Closing the or all Youtube tabs IMMEDIATELY fix the problem and CPU usage goes back to 0-3% for Firefox. Did not have this issue before upgrading to version 42.
Linux Mint 17.3 64 bit, Firefox 43

Same problem here! My CPU is AMD Athlon 2 X4 630 - 4 cores @ 2800Mhz. 
When I begin to watch some youtube video my computer becomes unstable and laggy. In fullscreen becomes even worse. I don't have this problem with the HTML5 player in chrome.
Verified on Windows 7 x64, Firefox 43 and on Nightly 46 and could not reproduce.

Update component to Audio/Video Playback. Also, please see Bug 970308, that could be related.
Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core
See Also: → 970308
Confirm on FreeBSD 10.3 with FF 44.0.2 (Intel opensource, I7-3630QM) . Cpu hits beyond 100% with playback of any HD video content on websites including youtube. It's very unusual to have such high cpu load even when software decoding used. For an instance, mpv rarely hits beyond 10% when playing HD content with forced software decoding and bare x11 output.

http://www.quirksmode.org/html5/tests/video.html
It happens to me, only in 60fps HD video with FF 44. I am currently using v43.0.4 and it works well. 
My specs: GTX 650, AMD Athlon 64 X2 Dual-Core, 4gb RAM.
This occurs for me, using any resolution or framerate, on FreeBSD 10.2 with FF 44.0.2. I often see over 130% cpu usage.

Using a media player like VLC uses only a few percent CPU usage.

I am using an AMD Radeon HD 8000 series GPU.
FreeBSD users may check the bug report below.That fixed my problem.

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203732
Andy - are you still seeing this issue? If so then can you paste in the graphics section from about:support and let me know what CPU you have.
Flags: needinfo?(andypublic)
I'm getting the same thing here, Apple MBA 2012 (Intel HD 4000).
VLC plays full screen h264 at 15-20%, FF 45.0.2 plays a 240p youtube video at 160% CPU.

Asynchronous Pan/Zoom	none
Device ID	0x0166
GPU Accelerated Windows	0/1 Basic (OMTC)
Supports Hardware H264 Decoding	No;
Vendor ID	0x8086
windowLayerManagerRemote	true
AzureCanvasBackend	skia
AzureContentBackend	quartz
AzureFallbackCanvasBackend	none
AzureSkiaAccelerated	1
(#0) Error	GLContext is disabled due to a previous crash.
(#5) Error	GLContext is disabled due to a previous crash.
(#6) Error	GLContext is disabled due to a previous crash.
(#7) Error	GLContext is disabled due to a previous crash.
(#8) Error	GLContext is disabled due to a previous crash.
(#9) Error	GLContext is disabled due to a previous crash.
(In reply to johan.sten from comment #16)
> I'm getting the same thing here, Apple MBA 2012 (Intel HD 4000).
> VLC plays full screen h264 at 15-20%, FF 45.0.2 plays a 240p youtube video
> at 160% CPU.

You should file a separate bug for Mac and include the OS version.
OS: Unspecified → Windows 7
(In reply to Smith from comment #9)
> Same problem here! My CPU is AMD Athlon 2 X4 630 - 4 cores @ 2800Mhz. 
> When I begin to watch some youtube video my computer becomes unstable and
> laggy. In fullscreen becomes even worse. I don't have this problem with the
> HTML5 player in chrome.

Linux currently uses basic layers for composition and performance is being improved in bug 1253062. There is also some work toward getting GL layers working which includes moving to GTK3.
platform-rel: --- → ?
Whiteboard: [platform-rel-Youtube]
platform-rel: ? → ---
1445470 - [tracking] video playback performance
<https://bugzilla.mozilla.org/show_bug.cgi?id=1445470>
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P2
Blocks: video-perf
Flags: needinfo?(andypublic)

Closing out old video perf bugs that are not well scoped.

No longer blocks: video-perf
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: