Bohl's Blog

my digital life

driving ffmpeg

Ffmpeg is one of the open-source projects that have been fascinating me since its first days. I admire the project for what it has archieved, the quality of this piece of code is just marvelous. I had been in the video-editing business for quite some time, and maybe have a good grasp of what wonderful a tool those guys have put together. In particular, the approach to have all pieces in one binary has always attracted me - after having wasted countless hours in DLL- and codec-hell.

However, so far I did not have a chance to put ffmpeg to work in a serious (i.e. paid for) project. Now this chance seems to have arrived, and I am very excited of it. In short, the goal is to use ffmpeg to create movies from a series of images, no audio at this time. So far the implementation uses DirectShow (yes, I am a die-hard DirectShow-fan) - however, DirectShow right out of the box does not offer a lot of video formats. Sure, there are tons of codecs for every format one can think of - but going this route would inevitably mean to enter codec-hell once more. Then, there is MediaFoundation - imho not really better suited for the task at hand, because at least as complex as DirectShow and (again, right out of the box) does not deliver that many new codecs or containers. So, I decided to give ffmpeg a shot.

The first decision is about how to interface with ffmpeg. Three possible choices seem feasible:

  • First create an AVI with DirectShow, then let ffmpeg convert it.
  • Use the ffmpeg-API (i.e. link with libavcodec/libformat and use their API)
  • transfer the source images into ffmpeg, where ffmpeg runs as a stand-alone process, let it encode and output it into a file

The first approach is for sure the lamest - but the easiest. In fact, performance is not that much a concern, so it is not immediately ruled out. The second is probably the most efficient and most solid approach, but there are quite a few drawbacks: besides (potential) legal issues it is about the problem of integrating it into a build-environment, worries about the stability of the API (and problems with updates of ffmpeg) and of course, the complexity of the API itself and the inevitable learning curve (and some more worries). So, I decided to take the third approach.

I was hoping that someone else already tried this out - and was hoping to find a nice library or code snippets for this task. To my astonishment a web search did not bring up many hits, at least not what I was hoping for. And the documentation on the ffmpeg-site itself for this was not too enlighting as well.

The basic idea is to use a named pipe in order to transport the images over to ffmpeg. I got this part (basically) working after some meandering. More on this in one of the next posts...

Install Windows8 Consumer Preview as VHD-Boot

Did you know that it is possible to install Windows8 (Consumer Preview at this time) into a VHD (and boot into this VHD). I knew about this feature before, but now it was finally time to give it a try.
The installation of Windows8 went smooth as described here (but now with Windows8 instead of Windows7). This is such a cool feature - no need to partition your harddisk or something, all is inside a single file!

VHDs are something I wanted to take a deeper look for quite some time - for different purposes, as a kind of "general container format" or so. I hope I will find time to blog my thoughts about this topic.


Today I had great fun with my Intel© SSD. I switched the PC on, and -in a nutshell- soon bad things happened. As it turned out, the SSD-drive (Intel SSD 320 Series, 160GB) was broken. It was listed as an 8MB-drive with the serial-number "BAD_CTX 00000166". A quick search on the Internet revealed that I am not the only one with this kind of trouble... However - most other bricked devices seem to report "BAD_CTX 00000136" or so (the famous firmware bug related to problems with power loss). I tried all sorts of things (changing the cable, the HDD-port and so on) to no avail.


After I had given up any hope on recovering the data (no, I do not have a complete and recent backup, just in case you wonder...) I was ready to give "Secure erase" a chance (as it was recommended in many posts on the internet). Well, it took quite some time and fiddling around, but finally I was able to execute the Secure erase function in the Intel Toolbox. And surprise, surprise - it put the device to life again. We will see how long this life will last... Or should I have better RMAed the drive?

My trust in SSDs obviously has dropped significantly, that's for sure.

On with Like and +1

I had to fiddle with the Like-/PlusOne-buttons once more. My previous attempt had a bug (the +1-button did not work properly), so I decided to give AddThis.Net a shot. It worked flawlessly (after some tweaks), is properly integrated into and seems well done overall. The tweaking was just to add a using statement in all cs-files (using BlogEngine.Core.Web.Extensions;) - seems to be an incompatibility with version 2.5 of Besides this - no problems.
What I did not like about AddThis.Net was that it added the buttons below the text (or above) like this:


Whereas I prefer it in the place where it is now. So, for the time being, I am sticking with my approach. Of course, I fixed the problem and rolled up with AddThis. We will see how this works out...


EDIT: This is getting funny... it seems that AddThis.Net today got updated → So, maybe this story continues...

TrackMania does not like Microsoft Sidewinder Force Feedback 2 Joystick

Recently, I bought a copy of TrackMania2 Canyon - a racing game I like very much. However - at seemingly random occasions the game just froze. The whole application just froze and I could do nothing but kill the app in taskmanager. I fiddled with all the available options to no avail. After quite some time I realized that the problem only occured when I used my good old Sidewinder Force Feedback 2 Joystick. If I play the game with just the keyboard or with a gamepad I happened to have lying around - all is fine. Well, of course this device is a bit outdated and is discontinued - but works still perfectly and I like it very much. I have no idea what the problem is or what to do about it. I could not find any updated drivers or something so far. Should I buy a different controller or is there some solution for this problem?

Like or +1 my posts

New feature for the blog: I added a Like- and +1-button to the blog's frames. This is about these two guys:


I did not find a ready-made plug-in or something for Is this possible - or did I miss something? This plug-in did not work for me: some compile-error and so on, I did not look deeper into the subject (since the last update to this project dates back to 2009). So, I ended up adding these buttons by hand.

Just in case (remindeder for myself):
get your code for Facebook's Like-button here:
and for Google's +1-button here:


EDIT: I should have looked harder... of course there is a plugin for this: AddThis.NET v5. OK, I'll switch to this any time soon...

my new blog - finally up and running?

Finally, after a couple of failed attempts - my new blog is up and running!

I put this together on a V-server running WindowsServer2008. I used Microsoft's WebMatrix - which makes the installation a child's play. ...or at least, that is what it seemed to be. In fact, it took me the better part of the day to figure out how to publish the site using WebDeploy. The setup of WebDeploy worked like described here or here - the problem was that the "Management Service Delegation"-icon did not show up. And, needless to say, deploying a site did not work. After a while I found this, and the procedure with downloading the standalone installer and installing it with custom settings finally did the trick.
Not sure if I missed something or screwed something up in the course of trying to fix this, though.

Well, there is a lot to be learned...