Youtube Video Annotations Player
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md Updated with the new Google URL for the annotation data Oct 26, 2013
youtubeAnnotations.py First public commit Mar 27, 2012

README.md

Read my blog post for details about this: It allows you to playback Youtube videos with their annotations, offline (via MPlayer). In what follows, change 'o0BgAp11C9s' to whatever your Youtube video id is (the last part of the Youtube video URL).

  1. You download your video from youtube (via youtube-dl):

    $ youtube-dl -o vimPower.flv 'http://www.youtube.com/watch?v=o0BgAp11C9s'

  2. You then download the video's annotation data:

    $ wget -O annotations.xml 'http://www.youtube.com/annotations_auth/read2?feat=TCS&video_id=o0BgAp11C9s'

Update, October 2013: The service URL has now moved to:

$ wget -O annotations.xml 'https://www.youtube.com/annotations_invideo?features=0&legacy=1&video_id=o0BgAp11C9s'
  1. Then you run my tiny Python script:

    $ youtubeAnnotations.py annotations.xml vimPower.flv

The script then...

  • creates the MPlayer's bmovl filter FIFO
  • spawns a patched MPlayer (due to a bmovl bug!) as a child process, with the required arguments for the bmovl filter
  • starts keeping track of playback time, and based on the anchoredRegions timestamps...
  • creates bitmaps from the TEXT regions via ImageMagick
  • and sends them over to the MPlayer's bmovl FIFO for displaying

The script worked fine for my VIM video, and I have also tested it on a few other Youtube videos. You can also see the results in a full-HD version of the same video. If you do decide to use this script, please remember that you must also patch your MPlayer, since the bmovl filter is currently (2012/03) broken.

Enjoy!