Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I play a video (H264 MPEG4 AVC 320x180) online (in Firefox or Chrome) it uses to consume up to 100% CPU, but if I download it (exactly the file played) and use VLC - it takes just 5% (6% at maximum). Why does this happen and what can I do to make on-line players more efficient?

PS: The video card is Intel GMA X4500HD.

share|improve this question
    
Is the file in the browser being played using Flash or using HTML5? What are the figures for playing in Totem (using GStreamer)? –  8128 Mar 27 '12 at 9:13
    
I've already said that's Flash. I have no Totem to try, but I believe it wont be much worse than VLC. –  Ivan Mar 28 '12 at 11:17
    
I assume Flash-plugin + Browser (Firefox, Chrome,..) is a much more complex system than a movie player as VLC. I don't mean that movie players are simple, but I would guess there are less components interacting than within a browser. –  math Mar 30 '12 at 7:31
    
Heavy CPU usage is not restricted to VIDEO but also applies to STREAMING AUDIO (e.g. RADIO stations) in Firefox or Chromium; streaming in VLC is sooo much more lightweight in comparison! –  nutty about natty Feb 17 '13 at 11:15
add comment

1 Answer 1

The probable reason is that the Flash plugin cannot take advantage of any kind of hardware acceleration supported by your graphics card driver. Everything is then decoded using the CPU.

The Intel drivers present in your system allow VLC to use your GPU instead of your CPU to render the movie with video acceleration which is much better for obvious reasons.

Also, Flash hardware acceleration API (Stage Video) requires developers to actually add support for it into their video player SWFs.

If the video player does not have built in support for it even if the version of Flash you have does have VA enabled and your drivers support it (seems they do since VLC is apparently using it) your video will be decoded via the CPU.

share|improve this answer
    
But shouldn't Flash on Linux be able to make use of the graphics hardware acceleration since 10.2 beta? See phoronix.com/… –  nem75 Mar 28 '12 at 8:25
    
@nem75 not if the video player you are using was compiled without support or if the Flash plugin fails to use your video card acceleration features, remember we are talking here about an Intel, not a Nvidia or ATI. –  Bruno Pereira Mar 28 '12 at 8:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.