Skip to main content
MrX1980
Legend
December 30, 2012
Answered

High CPU usage while buffering a video

  • December 30, 2012
  • 5 replies
  • 6674 views

I have a high CPU usage (over 40%) while only buffering this video.

IE10pre1

http://www.album.de/img1/big/245/24531555762898.jpg

Firefox Nightly 20121229, protected mode enabled

http://www.album.de/img1/big/245/24534636762445.jpg

Firefox Nightly 20121229, protected mode disabled

http://www.album.de/img1/big/245/24534669273271.jpg

Opera Next

http://www.album.de/img1/big/245/24534729495827.jpg

Chrome Canary

http://www.album.de/img1/big/245/24534715956882.jpg

a) open this url: http://www.wimp.com/marsearth/

b) pause the video if it starts automatically

c) use task manager or process explorer to view the cpu/gpu usage

reproducible: mostly

Windows 7 SP1

Flash Player 11.6.602.108 / HWA enabled

TestPC: Gigabyte GA-K8NS Pro; AMD Athlon 64 Venice 3200+; 2x 1GB MDT DDR-400-CL2; Club3D HD4670 AGP; Samsung HD103SJ, SyncMaster 204BM

This topic has been closed for replies.
Correct answer jeromiec83223024

... and I see that If pause the video it is stopping for a few ms and then decoding a few more frames and stopping again.

If I find the time I will create a video of this behavior.


While we're aware of the issue, there's not much we can do about it.  The modern security realities facing web browsers have made sandboxing a necessity. 

There's a good explanation of what's happening here: http://blogs.adobe.com/asset/2012/06/inside-flash-player-protected-mode-for-firefox.html

Long story short, each video packet has to be passed from the browser to a medium-integrity broker process, then to the low-integrity flash player process for rendering.  If an attacker manages to hijack the Flash Player thread, the process is low-integrity, which prevents the attacker from doing much with it.  While it's not an absolute guarantee (nothing in security is), it raises the bar significantly for attackers.

The downside is that all of that extra message-passing consumes CPU cycles, especially if you're trying to fill an exceptionally large buffer as fast as possible.  There's not a lot of opportunity to optimize this.

If you're fine with the risk, you can manually disable ProtectedMode on your machine.  If you're only dealing with trusted sites, and you're not doing anything critical with the machine (work, banking, etc), then it's probably not a huge deal.

Ultimately, ProtectedMode is like a vaccine -- it's a herd-immunity thing.  If the majority of people run it, exploits targeting machines without it are inconsistent and probably not worth pursuing when you look at the effort involved in developing an end-to-end exploit.  If a large number of people disable it, it becomes economically attractive for people building botnets, and you'll have a problem if you're not using it.

To disable Protected Mode, add the following line to your mms.cfg file located in:

Windows 32bit: C:\windows\system32\macromed\flash

Windows 64bit: C:\windows\syswow64\macromed\flash

ProtectedMode=0 

If the mms.cfg file does not exist, create one using any standard text editor (e.g.. notepad)

Depending on your operating system, you might need to first save the mms.cfg file to a writable location (such as your documents or desktop folder) and then copy the file into the destination folder using Windows Explorer.

To re-enable Protected Mode, simply remove the line from the mms.cfg file.

5 replies

Participating Frequently
April 12, 2013

And I want to add:

not only does the Flash plugin use like 40% during buffering, but also Firefox process uses 20 to 30% CPU and plugin container also like 20% in my single core.

Only the video buffering, no other sites, no advertisement animation.

Participating Frequently
April 11, 2013

With a single core CPU (AMD 2GHz) this is a real problem.

Buffering uses up to 40% CPU, so less CPU power left for actual playback processing -> stuttering/dropped frames. Better playback when buffering of whole video is finished.

Problem: many video sites don't allow long buffers.

-> Buffering should cause less CPU load.

Flash 11.7. Vista, Firefox 20.

Participating Frequently
April 11, 2013

Same problem here, try this video on Firefox with protected mode enabled and buffer the video choosing 720p, is even worse than your example: http://youtu.be/fUh8XGGdLSg

MrX1980
MrX1980Author
Legend
April 11, 2013

FuriousUser wrote:

Same problem here, try this video on Firefox with protected mode enabled and buffer the video choosing 720p, is even worse than your example: http://youtu.be/fUh8XGGdLSg

Hi, a good example. Thanks

My debug values on my Intel P4 3.06GHz notebook with WinXP / Firefox Nightly (20130411030925):

cl=45165856&ts=1365699726&decoding=software&fmt=22&referrer=null&el=detailpage&md=1&h=481&csipt=watch7&vid=uqmffoZHXuMKcDkGApiedzRa7flGDEIYC&ptk=munivinacl&feature=youtu%2Ebe&cos=Windows&hasstoryboard=1&c=WEB&next%5Fid=fUh8XGGdLSg&cosver=5%2E1&nsiabbl=39266&sd=B55B6FA88MH1365717414502870&nsivbbl=1644990&vw=1280&vh=720&cpn=tzqrSRTHlB3H6%5F9%5F&droppedFrames=99&fexp=910223%2C931202%2C931203%2C906436%2C929223%2C920201%2C929602%2C919373%2C906383%2C916624%2C925714%2C906836%2C900821%2C900823%2C919512%2C932000%2C932004%2C901208%2C901482%2C909419%2C916910%2C929903%2C902000%2C908529%2C906090%2C930803%2C930101%2C930807%2C900824&tpmt=4&w=854&cver=as3&cfps=0&cplatform=DESKTOP&screenw=1024&cbr=Firefox&debug%5FvideoId=fUh8XGGdLSg&screenh=768&idpj=0&ldpj=0&pixel%5Fratio=1&playerw=854&cr=DE&debug%5FflashVersion=WIN%2011%2C7%2C700%2C178&playerh=510&debug%5FplaybackQuality=hd720&debug%5Fdate=Fri%20Apr%2012%2000%3A00%3A14%20GMT%2B0200%202013&scoville=1&sendtmp=1&pd=0&debug%5FsourceData=B55B6FA88MH1365717414502870&videoFps=0&mos=0&stageFps=10&hl=en%5FUS&cbrver=23%2E0%2Cgzip%28gfe&vq=hd720&abd=1&nsidf=99&fs=0&sdetail=f%253Ayoutu%2Ebe%252C&plid=AATaHNzKpEctX%2DQ1&lact=193520&volume=100&rendering=software

jeromiec83223024
Inspiring
April 12, 2013

Software-based decoding is CPU intensive on desktop hardware. You're on a netbook, and the debug values you provided above indicate that Youtube is using software decoding: decoding=software.

We did all of the hardware acceleration work in Flash Player 11 specifically to enable H.264 decoding on netbooks and lower-end/low-power devices.  The purpose-built video decoding hardware on your GPU is much better for this task.  I'm not sure why Youtube is not using hardware acceleration is not enabled in this situation. 

Ultimately, it's the video player that makes the decision about hardware vs software, although you should probably confirm that you have Hardware Acceleration enabled in Flash (right click > settings > left-tab (display) > Enable hardware acceleration), and in your browser.

ProtectedMode in Firefox also adds some significant overhead, which is probably exacerbating the situation on this type of hardware.  I'd recommend first trying Chrome.  If that doesn't work out, you can disable ProtectedMode, but I'd only do that as a last resort.

MrX1980
MrX1980Author
Legend
January 16, 2013

Flash Player 11.6.602.146 / .108 / difference

Internet Explorer 10pre1 ~ 28% / ~43% / -15%

Firefox Nightly 20130115, protected mode disabled ~38% / ~26% / +12%

Opera Next 12.12 1707 ~55% / ~54% / +1%

Chrome Canary 26.0.1384.2 ~65% / ~57% / +8%

Firefox Nightly 20130115, protected mode enabled ~78% / ~81 % / +3%

jeromiec83223024
Inspiring
January 16, 2013

Thanks for the update.  This bug is still open, but isn't going to make it for the initial 11.6 release.

I'll continue to push on it to get a resolution.

MrX1980
MrX1980Author
Legend
December 30, 2012

If someone has the same problem vote here:

https://bugbase.adobe.com/index.cfm?event=bug&id=3434552

jeromiec83223024
Inspiring
January 2, 2013

Thanks.  This is already on my radar, and there's a corresponding Firefox bug.  The additional browser information was very helpful, thanks.