Watching videos with hardware acceleration enabled gives me sound but no image

According to the information posted on your question you have a hybrid GPU solution that uses Intel + Nvidia at the same time.

To enable your Nvidia card you need to install Bumblebee or disable the Intel card in your BIOS (if possible).

If disabling your Intel card in your computer's BIOS is not an option you have no choice other than use Bumblebee.

If you need information about Bumblebee please have a look at this post, it explains in detail how to enable support to run Ubuntu with both the Intel and the Nvidia card activated

  • Is a NVIDIA GeForce with Optimus Technology supported by Ubuntu?

If you are using Bumblebee already that does not mean that vdpau support is installed, you need to install vdpau support for your card as described here

  • How to enable VDPAU on GStreamer?

After you have successfully managed run run bumblebee vainfo will still fail because the Intel card will still be the default card.

I have found a script that will switch the card from the Intel to the Nvidia and try to open the media player. The basic instructions to use this are described here, remember this is a script from outside sources, no warranties that this will work are given, you can test it yourself.

Here are the instructions taken from the bug report:

  1. Build hybrid-windump but don't use the included xorg.conf! https://github.com/harp1n/hybrid-windump (includes borders for entire dumped window) https://github.com/gebart/hybrid-windump (included better cursor support, but dumped window will cover portion of Intel desktop and can't be moved)

  2. Start the Bumblebee X server optirun glxinfo

  3. Run Compiz (or Metacity) on Nvidia display so the dumped window can be moved around. If you skip this, VDPAU playback will be green. DISPLAY=:8 compiz --replace &

  4. Run mplayer2 DISPLAY=:8 mplayer -vo vdpau videofilename &

  5. Dump window ./windump :8 :0.0 &

  6. You now have VDPAU output!

NB: This also works with Ironhide.