Beautify Contextual Related Posts WordPress plugin

I’m a long time user of the Contextual Related Posts plugin for WordPress.

The thing is that if you activate thumbnails, you’ll end up with this kind of ugly list:

So I’ve written some CSS to beautify this, and make the final result aligns with TwentyEleven (WordPress default theme):

And here is the CSS producing the result above:

#crp_related ul {
  list-style: none;
  float: left;
  margin: 0;
}
#crp_related li, #crp_related a {
  float: left;
  overflow: hidden;
  position: relative;
  text-align: center;
}
#crp_related li {
  margin: .9em;
  border: 1px solid #ddd;
  padding: 6px;
}
#crp_related li:hover {
  background: #eee;
  border-color: #bbb;
}
#crp_related a {
  width: 150px;
  height: 150px;
}
#crp_related a:hover {
  text-decoration: none;
}
#crp_related img {
  max-width: 150px;
  margin: auto;
}
#crp_related .crp_title {
  position: absolute;
  height: inherit;
  bottom: 6px;
  left: 6px;
  padding: 3px;
  width: 144px;  /* = 150px - (3px * 2) */
  color: #fff;
  font-size: .9em;
  text-shadow: #000 .1em .1em .2em;
  background: rgb(0.5, 0.5, 0.5);
  background: rgba(0, 0, 0, 0.5);
}
#crp_related li:hover .crp_title {
  background: rgb(0.2, 0.2, 0.2);
  background: rgba(0, 0, 0, 0.8);
}

I’ve integrated this CSS code via a widget, using the same technique I’ve detailed here.

This CSS was tested against the version 1.7.2 of Contextual Related Posts, and for reference, here is my plugin configuration:

And FYI, my post default thumbnail is from KDE’s Oxygen icon set, which I found on my system in /usr/share/icons/oxygen/128x128/apps/knotes.png.

Video summary of latest Cool Cavemen’s concert

Featured

I’ve just finished editing the video summary of the latest Cool Cavemen’s concert. It’s now available on YouTube:

That video was mostly shot with my Canon EOS 7D in 1080p at 24fps, with a Tamron SP AF 17-50mm f/2.8 XR Di-II VC LD IF lens.

The final video also include footage from various people in the audience:

The video was edited with the latest version of Kdenlive and exported to a 1080p/24fps stream:

If you enjoyed the music and atmosphere of the video, I urge you to go to the next Cool Cavemen’s concert. And because I know the majority of my readership can’t be in the north of France next month, let me remind you there’s still a one hour video of our biggest 2009 concert available online (on which I did all the lighting).

And if you liked the first song, its called Belgique mon Namurrr and you can watch the whole of it here (lyrics are in subtitles):

I contributed $200 to Kdenlive and you should too !

I just donated $200 to the Kdenlive project, as they have just started a fundraising campaign to refactor its core and make it future-proof:

The amount of collected funds is currently at $3,041 from the $4,000 required to pay a developer to work full-time for 2 months. With only $959 remaining and 41 days left, you have no reason to not contribute to the best open-source video editor out there.

I started to play with Kdenlive several years ago with version 0.3. I even created some RPM packages back then. Kdenlive suffered from heavy instabilities in its early days.

But this was a long time ago and today it’s the most stable and practical video editing software available on Linux. It’s the best open-source tool for amateur DSLR shooters, and is worth a try even if your primary desktop manager is not KDE.

Today this software is the one I spend most of my time in at home (just after a web browser and a command-line terminal). And I’ve never felt as productive as the last 2 years: I edited about 2 hours of videos in that period.

Kdenlive must continue to grow. And because I want to use it in my future projects, it makes sense to make a donation. So what are you waiting for contributing too ? :)

4m² : the first short I worked on

Featured

4m², the first narrative short film I work on, was just made available on YouTube. I wasn’t expecting a public release that fast (and this makes a really pleasant surprise), so I had no time to prepare a more detailed article. I’ll try to write one soon, but in the mean time, enjoy the final result of a great teamwork:

And here are the official stills of the short:

Dump, backup and restore a PostgreSQL database

Between user rights, permissions, templates and encoding, believe me or not, but I had some troubles finding a consistent procedure to dump, backup and restore a PostgreSQL database. That’s expected as I’m new to this RDBMS.

So here is the sequence of commands I use to dump a database from a server and copy it to another:

postgres@source-server:~$ pg_dump my_db -v --format=c --file=./my_db_2011-11-23.dump
postgres@source-server:~$ scp ./my_db_2011-11-23.dump postgres@dest-server:~/

Before importing the dump to a new database:

postgres@dest-server:~$ createdb -E UTF8 -T template0 new_db
postgres@dest-server:~$ pg_restore -U my_user -d new_db ./my_db_2011-11-23.dump
postgres@dest-server:~$ psql --command "ALTER DATABASE new_db OWNER TO my_user;"

This hasn’t failed me yet, and I’ll update that post if it will.

Stabilizing Cute Baby Goats

Featured

Stabilizing WHAT ?!?

Baby goats. Cute baby goats. Yes, you’re reading it right. Look:

Yeah, I know, this is a naive video that belongs to /r/aww. But any excuse is good to me when its all about playing with video.

These kids (as baby goats are called) decided to come to this world the night I was around. In a hurry I grabbed my Canon 7D and filmed these newborns with a Sigma 30mm f/1.4 EX DC HSM to leverage its large aperture. And as expected, in the night, with no artificial light and no extra stabilization device, the resulting footage are extremely shaky.

I tried to stabilize the shots but was really disappointed by the results. The final version of the video you watched above only feature the original footage, without any stabilization. But for posterity, here are some notes about the tools I played with.

vid.stab

The first tool I tried was vid.stab, a Transcode plugin that is now part of Transcode itself. But the 1.1.5 version that is bundled with the current Ubuntu 11.10 is quite old.

I wanted to compile it from its sources. But the binary distribution available on the project website works out of the box. To save some effort, let’s install the latter:

$ wget http://public.hronopik.de/vid.stab/files/vid.stab-0.93-transcode-1.1-binary-x86_64.tgz
$ tar xvzf ./vid.stab-0.93-transcode-1.1-binary-x86_64.tgz
$ sudo mv ./vid.stab-0.93-transcode-1.1-binary-x84_64/filter_*.so /usr/lib/transcode/
$ rm -rf ./vid.stab-0.93-transcode-1.1-binary-x8*

Now, as explained in the documentation, you have to let transcode analyze the video:

$ transcode -J stabilize -i ./MVI_1714.MOV -y null,null -o dummy

Only after this first pass you can apply the stabilizing transformations:

$ transcode -J transform -i ./MVI_1714.MOV -y ffmpeg -F huffyuv -o ./MVI_1714-stabilized.MOV

If your not satisfied with the result, you can increase the area of tracking points with the shakiness parameter:

$ transcode -J stabilize=shakiness=8:show=1,preview -i ./MVI_1714.MOV -y null,null -o dummy

In the command line above we added the show=1,preview parameters, which have the nice effect of displaying a preview of the work done behind the scene:

And if you want to see the transformations applied in the final video, just deactivate the cropping and zooming mechanism:

$ transcode -J transform=crop=1:optzoom=0 -i ./MVI_1714.MOV -y ffmpeg -F huffyuv -o ./MVI_1714-stabilized.MOV

Finally, here are some command helpers to automate the stabilization process for a massive amount of video:

$ find ./ -name "*.MOV" -exec transcode -J stabilize -i "{}" -y null,null -o dummy \;
$ find ./ -name "*.MOV" -exec transcode -J transform -i "{}" -y ffmpeg -F huffyuv -o "{}.stabilized.avi" \;

Alternative tools

I told you I was disappointed by the results. For example, in the first shot of the video above, vid.stab will stabilize based on the movements of the head of the goat, not based on the background. All of this because tracking points are generated on hight-contrast area. Unfortunately in this first scene, the only high contrast area is the kid’s head.

Even in shots where the contrast is in our favor, software stabilization don’t always produce nice output. If by chance the tracking points are set on the right objects (those that should be considered motionless), the results may not be pleasing, as it may expose inappropriate skewed perspective, shifting motion-blur and spacial deformation.

While a little bit smarter, YouTube’s embedded stabilization effect still suffer from these same short-comings. If it tries to smooth out consecutive transformations better than vid.stab, it still fails to produce nice output devoid of unattractive artifacts.

Another tool worth trying is VirtualDub, which you can run under Wine and leverage its deshaker plugin. But I didn’t tested it.

Last but not least, Blender can be used to stabilize videos. Again I haven’t tried this yet, but I think it’s the best investment of you time, since the new tracking features make Blender a powerful tool for 3D integration.

Conclusion (tl;dr)

There is no silver bullet: don’t expect software stabilizer to save your shaky shots in post-production. If you want steady shots, plan them beforehand and use proper gear on site, be it a monopod, a tripod, a slider, a dolly, a crane or a steadicam. That’s the only way to eliminate the pain and deception when you hit the editing room.