Visualizing mpeg4 motion compensation vectors using mplayer

The MPEG4 video encoding process makes use of block motion compensation to achieve compression. The motion compensation process serves to produce the intra frames which are the frames between keyframes. I’ve always been fascinated by this process and was delighted to find out that my favorite video player, mplayer, allows one to visualize this process. I tried it and it is wonderful!

This is the video I tried the process on: download


motion compensation vector visualization
motion compensation vector visualization


motion compensation vector visualization
motion compensation vector visualization


motion compensation vector visualization
motion compensation vector visualization


motion compensation vector visualization


To try this out yourself, you will first need to have mplayer installed. If you are running Debian/Ubuntu, do this,

sudo apt-get install mplayer



After this, download the video using the link provided above. Run this command,

mplayer -lavdopts vismv=1 -vo x11 motion_vector_video.avi



To learn more about motion compensation, go here.
Enjoy!

No Trackbacks

2 Comments

  1. can you do the same for a sam anderson video and use those images?

    Posted April 2, 2008 at 4:25 pm | Permalink
  2. I tried it but mplayer was quitting after printing “hahahe heeehee. x86 code cannot take anymore of this.”. I tried googling but this seems to be a unique case! ;)

    Posted April 2, 2008 at 4:37 pm | Permalink