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.

BAD_CTX

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 blogengine.net 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 blogengine.net. 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 → http://dnbegallery.org/cms/List/Extensions/AddThis. 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 blogengine.net. 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: https://developers.facebook.com/docs/reference/plugins/like/
and for Google's +1-button here: http://www.google.com/webmasters/+1/button/

 

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...

Welcome to BlogEngine.NET 2.5

If you see this post it means that BlogEngine.NET 2.5 is running and the hard part of creating your own blog is done. There is only a few things left to do.

Write Permissions

To be able to log in to the blog and writing posts, you need to enable write permissions on the App_Data folder. If your blog is hosted at a hosting provider, you can either log into your account’s admin page or call the support. You need write permissions on the App_Data folder because all posts, comments, and blog attachments are saved as XML files and placed in the App_Data folder. 

If you wish to use a database to to store your blog data, we still encourage you to enable this write access for an images you may wish to store for your blog posts.  If you are interested in using Microsoft SQL Server, MySQL, SQL CE, or other databases, please see the BlogEngine wiki to get started.

Security

When you've got write permissions to the App_Data folder, you need to change the username and password. Find the sign-in link located either at the bottom or top of the page depending on your current theme and click it. Now enter "admin" in both the username and password fields and click the button. You will now see an admin menu appear. It has a link to the "Users" admin page. From there you can change the username and password.  Passwords are hashed by default so if you lose your password, please see the BlogEngine wiki for information on recovery.

Configuration and Profile

Now that you have your blog secured, take a look through the settings and give your new blog a title.  BlogEngine.NET 2.5 is set up to take full advantage of of many semantic formats and technologies such as FOAF, SIOC and APML. It means that the content stored in your BlogEngine.NET installation will be fully portable and auto-discoverable.  Be sure to fill in your author profile to take better advantage of this.

Themes, Widgets & Extensions

One last thing to consider is customizing the look of your blog.  We have a few themes available right out of the box including two fully setup to use our new widget framework.  The widget framework allows drop and drag placement on your side bar as well as editing and configuration right in the widget while you are logged in.  Extensions allow you to extend and customize the behaivor of your blog.  Be sure to check the BlogEngine.NET Gallery at dnbegallery.org as the go-to location for downloading widgets, themes and extensions.

On the web

You can find BlogEngine.NET on the official website. Here you'll find tutorials, documentation, tips and tricks and much more. The ongoing development of BlogEngine.NET can be followed at CodePlex where the daily builds will be published for anyone to download.  Again, new themes, widgets and extensions can be downloaded at the BlogEngine.NET gallery.

Good luck and happy writing.

The BlogEngine.NET team