Tag: video

Browser hardware acceleration issue?

Browser hardware acceleration is meant to render websites faster by allowing the graphics card (its GPU) to directly display “things” (videos, animation, canvas, compositing, etc.) on the screen. By bypassing software rendering systems, lots of websites seem to render faster. All major browsers jumped on this: Firefox, Chrome, Internet Explorer and Opera (post of 2008!).

I understand that enhancing the user’s experience while surfing the web is something that can be interesting. Hardware acceleration opens the door to unseen compositions, to new types of animations, to new kind of applications. Directly in your favourite browser.

Comment if I’m wrong but hardware acceleration will not lead to fragmentation of the web landscape. HTML5 seems to be the standard behind which browsers developers are adding their acceleration engines.

However, an issue (from the user’s point-of-view) will probably be that hardware acceleration will still help the emergence of a consumer-only web. A lot of your applications will be in your browser, with your data in someone else’s data center. You want your data safe? You need to trust your provider’s security measures. You simply want your data on your hard drive? I think you’ll have a problem here. But I agree it’s not the technical implementation that will be responsible for that.

First LaTeX Beamer presentation seen in a proteomic conference There is another issue I see with browser hardware acceleration. And it’s very down-to-earth. As you often encounter in presentation with videos, the presentation is displayed via a beamer but not the video (a black rectangle is displayed instead). You can easily disable hardware acceleration in most presentation software (if it’s not disabled by default). But, with hardware acceleration fully integrated in the browser, what will be displayed with the beamer if we have to do a demo of a website or simply when the presentation software is the browser? A page with patches of black rectangles? I hope not.

Why do I blog this? I enjoy reading about the (technical) details of (browser) hardware acceleration. I am very interested in general in all the new developments in IT regarding the use of GPUs and graphics card computational power to solve current issue or allow future developments. But I’m also using these (new) technologies everyday. So I don’t want that technological improvements on one hand turn to cause trouble on the other hand.

Let my dataset change your mindset

In the previous post, I shared a video of David McCandless giving a talk about information visualisation. One phrase caught my attention and a bit of research lead to a very good discovery. The phrase and context is (emphasis is mine):

We need relative figures that are connected to other data so that we can see a fuller picture, and then that can lead to us changing our perspective. As Hans Rosling, the master, my master, said, “Let the dataset change your mindset“. And if it can do that, maybe it can also change your behavior.

Who is Hans Rosling? A Professor of International Health at Karolinska Institute and Director of the Gapminder Foundation (from Wikipedia). Nothing fancy nor anything related to information visualisation at first sight. Except that the Gapminder Foundation is “a non-profit venture promoting sustainable global development and achievement of the United Nations Millennium Development Goals“. So what? Gapminder also “pursue[s] the development of the Trendalyzer […] [seeking] to unveil the beauty of statistical time series by converting boring numbers into enjoyable, animated and interactive graphics“.

And this software is really great (see screenshot below but, above all, in all Rosling’s videos): from one single interface, you can gather lots of different types and sources of data (about the development of the countries of the world) on the same chart and it nicely display them along more than the two dimensions of your screen. Bubble sizes and colours represent other dimensions. And the whole thing move with time (years).

Trendanalyzer screenshot

What is also very interesting is that you can play with Trendanalyzer (in Gapminder world) and download the data behind it. In addition, Google acquired Trendanalyzer and offers some of its components as a “gadget”: Motion Chart.

The beauty of the software is nothing without appropriate use. And in all of his videos, Hans Rosling makes appropriate use of data visualisation, succeeding in converting messages heavily relying on statistics and various sources of data (not something usually visual attractive) in simple visualisations. As David McCandless said: “It’s effortless; it literally pours in”. By visualising it in such a way, it’s more easy for the dataset to try to change your mindset.

Because the tool isn’t everything. With its help, Hans Rosling is trying to convey messages. And if you watch any of his videos, you’ll see that he effectively succeeds in doing it wether it’s to make you stop talking about “developing” countries or to make you think about the role of the end of poverty in the growth of world population, for example. In his Six Minutes blog, Andrew Dlugan summarises Hans Rosling’s technique in 6 points:

  1. Explain the data axes
  2. Highlight subsets of data
  3. Dig deeper to unwrap data
  4. Place labels close to data points
  5. Answer the “Why?” questions
  6. Complement data with energetic delivery

Hans Rosling presenting The seemingly impossible is possible at TED 2007

Althought some of these techniques were taught or discovered by own practise during B.Sc./M.Sc./Ph.D., the combination of them make a presentation very effective, even in front of a small audience.

Why do I blog this? I watched all Rosling’s videos in one go. Once the current presentation was over, it was difficult to resist to watch the next one. From a general perspective, I’m very interested in all means to ease the way people can grasp huge amount of data and to maintain their interest during presentations. From a more practical perspective, I’m starting to deal with some amount of information for various projects and I’m looking for attractive ways to show them. And I was about to forget Hans Rosling is professor of Global Health, a field close to my current one: Health Economics. You couldn’t dream of a better thing than learning more about your field with interesting ideas and appealing presentations.
What triggered the redaction of this blog post is the release of a 55-minute documentary about Hans Rosling’s life and thoughts on YouTube.

David McCandless on information visualisation

Tonight, I realised that David McCandless was behind informationisbeautiful.net, a blog dedicated to information visualisation which I often mentionned before on this blog.

David McCandless speaking at TED, July 2010

Last month, David McCandless gave a talk at TED, a NGO “devoted to Ideas Worth Spreading”. And it was very interesting to hear him, to put a living face on a blog and to apprehend the amount of work to make such great infographics simple to understand. Here is the video (thanks to the license: CC-by-nc-ndon this page, there is a link to download the high quality video):

http://video.ted.com/assets/player/swf/EmbedPlayer.swf

Why do I blog this? I was always and I am still interested in information visualisation, could it be from others (like the flu tracker or, more modestly, my own attempts (to stay in the flu topic). As David said, everyday, everyone of us is blasted by information design, it’s being poured into our eyes, it’s a “dormant litteracy”. And I am curious of new ways of visually presenting large datasets like at the Hack.lu 2009 InfoVis Contest or results of time-consuming models of disease spread.
But of course, on the other hand, you have to ask the right questions, look from the right angle: the one who master information design may also influence the minds of those who see this information and, more importantly, its interpretation. David McCandless didn’t say anything about this: the responsability of the designer regarding the interpretation of his/her design.

Bittorrent used to deploy updates

I just watched a video from Larry Gadea working at Twitter: Twitter – Murder Bittorrent Deploy System (speaking at CUSEC 2010).

Briefly, the problem Twitter was facing was the deployment of updates to thousands of servers in a short amount of time and dealing with errors (broken servers, e.g.). A nice, simple, cool and free way of solving this issue was to use the Bittorrent protocol (via Python and a stack of other free software) to actually deploy updates. In summary, you go from a unique repository facing thousands requests approximately at the same time:

And you end up with a nice “distribution chain”:

The beautiful thing is that they now go 75 times faster than before!

And now, the video:

http://vimeo.com/moogaloop.swf?clip_id=11280885&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=00ADEF&fullscreen=1

The Murder software is hosted on Github (Apache 2 license).

Why do I blog this? First, I like to see simple ideas no one had before implemented like this. I also wonder how other companies facing the same problems are doing (status.net for example ; I don’t think it could be useful for Forban). Finally, you see, Bittorrent is sometimes about good stuff too!

Baby movements during sleep

After a while, here is why I got a TV tuner for my Linux laptop, took screen captures and wrote a script to add a timestamp on pictures … I wanted to know how my (then 5-month-old) son was sleeping (his mom can be reassured: I was not planning to put electrodes on his scalp 😉 ).

Get the Flash Player to see this player.

var s1 = new SWFObject(“../videos/player.swf”,”ply”,”360″,”240″,”9″,”#FFFFFF”);
s1.addParam(“allowfullscreen”,”false”);
s1.addParam(“allowscriptaccess”,”sameDomain”);
s1.addParam(“flashvars”,”file=../videos/081129-night.flv&image=../videos/081129-night.jpg”);
s1.write(“container”);

Following this, I had interesting discussions with my dad about sleep patterns in babies. It could also be interesting to hybridize what we did for Gemvid and this simple solution in order to be able to quantify human/baby movements during sleep. My little knowledge of OpenCV can then come in handy for the motion and pattern detection …

Some additional technical details : Video was made from 321 TV screen captures (1 every 2 minutes) and played back at 1 frame per second. It was converted with FFmpeg (LGPL) and the Flash player is JW FLV Media Player (CC by-nc-sa). Ok: Flash is not free.

Taking automated screenshots from a live video camera

Following my previous post, I attached a video camera to the composite input of my tv tuner. One good thing I didn’t noticed yesterday is that mplayer can be told to directly use pvr:// as a source instead of the generic tv:// (with many options). So you just have to enter mplayer pvr:// -tv device=/dev/video1:input=0 in order to watch tv.

Noticed the input=0 above? This tells the tuner to take the video signal from the tv (read the mplayer man page to see how to change the channel). Now, since I connected my video camera to the composite video in, I need to tell mplayer to use it with input=1. One last thing: taking a screenshot in mplayer is done by pressing the ‘s’ key (with option -vf screenshot. In summary, the image below was taken with mplayer pvr:// -tv device=/dev/video1:input=1:noaudio -vo x11 -vf screenshot
(camera facing the screen).

blurry capture of computer screen taken by camera connected to tv tuner

Now I want to take one screenshot every 5 seconds, even when I’m not there to press the ‘s’ key! For this purpose, we need to use a fifo file and mplayer in slave mode. Mplayer in slave mode will listen to commands we automatically send into the fifo file (by a different process, see below). This is how we do this:

mkfifo myfifofile.tmp
mplayer -slave -input file=myfifofile.tmp pvr:// -tv device=/dev/video1:input=1:noaudio -vo x11 -vf screenshot

And from another console, we can type echo "screenshot 0" >> myfifofile.tmp to take the screenshot. To automate all this, the following simple bash code is sufficient:

#!/bin/bash
# will send mplayer screenshot command every 5 seconds to fifo file
# stop this with Ctrl + C
LIMIT=0
while [ $LIMIT -lt 1 ]; do
echo "screenshot 0" >> myfifofile.tmp
sleep 5
done

In the end, stop the bash script with Ctrl + C and quit mplayer with echo "quit" >> myfifofile.tmp.

JoVE and (self-)archiving?

In my previous post, I was glad to see that the Journal of Visualized Experiments (JoVE) was now indexed by PubMed. I then spent some time watching some very interesting videos. And I realized that something is missing …

In my mind, I thought that third-party archiving (like arXiv or self-archiving) was one of the mandatory requirements for Open Access journals … and I was wrong. It seems JoVE is not giving the (technical) possibility to download the publication from their website (all what you can download is the abstract in text version). Now that this publication is a video and not a text/PDF version, it’s a problem for me (who cares?) and the Open Access movement (imho).

“Classical” Open Access journals are “just” an evolution of traditional, Closed Access journals (or rather a return to the original transmission form of scientific papers): usually, you can read the paper on the journal website but you can also download it and print it if you want (for offline reading or if you still prefer articles on paper). The problem with videos is that you can’t print them. Is it a sufficient reason to forbid the download of these videos?

Fortunately, there is a technical trick to allow you to download the video (it will still be in Flash 9 format but this problem is currently out of our scope). Once you are on the page of the interesting video (example), view its source code (Ctrl+U in Firefox) and look for the string “xml_file_name”. You can now copy the value of this variable and you can stop before the first “%26” you encounter ; for our example, we’ll copy this: “http://www.jove.com/projects/VideoChapterXML/default.aspx?VideoID=211”. Enter this in your address bar and you’ll get another (XML) file (hence the name). Now on the first line, you’ll get the URL of your video in Flash format (flv); in our example: “http://source.jove.com/164.flv”.

In the future I wonder if JoVE will include a link to download its videos or it will obfuscate its source code in order to forbid further download.

Download YouTube videos

There are many websites around that allow you to download videos from YouTube. But it’s not possible to do it directly from YouTube. And you end up with a proprietary Flash video file. Although you can install the Flash plug-in on your computer, there are cases when you don’t want to do so or you are even not able to do so.

YouTube without Flash player

So, for whatever reason, you want a video from YouTube on your computer in a file format suitable for any kind of multimedia viewer? Here is a small (15 lines) bash script to download and convert a YouTube video you like in standard MPEG format. For that purpose, you’ll need wget (usually, you already have it on your GNU/Linux box) and ffmpeg.

Now, suppose you want to watch a video about Morris water maze, just look at the URL (http://youtube.com/watch?v=y2kJ2Zw9ZgI) and you’ll see the video ID (y2kJ2Zw9ZgI). Now, copy this ID and choose a proper filename for your file. Simply type “./youtubedownload.sh y2kJ2Zw9ZgI MorrisWaterMazeVideo” and after a few seconds, you’ll get a file called MorrisWaterMazeVideo.mpeg you can watch with the player you want. 🙂

Note 1: it doesn’t work with all the files on YouTube but almost all of them
Note2: Google Video gives the opportunity to directly download videos in mp4 format (which is standaradized)