Making of “Info TGV” Android app video

Featured

Last week I was called by one of my co-worker from Uperto (the open-source division of Devoteam). He knew I worked on some video projects for my band, so he asked me if I wanted to help him create one. The video was meant to be released 5 days later, so we clearly were in a hurry. However this was a great oportunity to play with my Canon EOS 7D, so I accepted ! :)

The goal of the video was to show off an Android application we made, for a contest organized by SNCF (the french national railroad). The application, that we simply named Info TGV, is designed to centralize informations for on-board staff. This application will give train personnel better insights when delays or other kind of traffic perturbations arise.

Here is the final video we managed to create:

Now let’s talk about what happened behind the scenes ! :)

Shooting

In all of my projects, I want to use free and open-source software, and push their usage for every step of the creation workflow. For video recording, there is no open-source firmware for the 7D. Sadly, the Magic Lantern community seems to have reached a dead-end regarding 7D support. I’m quite sad as I choosed the 7D a year ago for 2 things: its video capabilities and the potential hackability of this camera (extrapolating Magic Lantern’s success on the 5D Mark II). But this doesn’t stop me to get usable footages. Far from it.

For this video, I choose to use my Sigma 30mm f/1.4 lens as it’s the fastest lens I have today. I wanted to reduce the depth of field as much as I can to emphasize the screen of the HTC Desire, as all the important “action” takes place in the plane of the phone’s screen.

So I set my 7D to record in 1080p at 25 fps, open the lens at f/1.4 and set the shutter speed to a traditional 1/50s. I then set the ISO to 160 (which is the lowest native ISO value available on the 7D). Still, the final image was over-exposed so I attached a variable ND-filter to the lens and tuned it until I had an acceptable result. I finally customized the white balance to match the ambient light temperature.

Here is a snapshot of this first test on my Samsung Galaxy S (notice the strong vignetting created by the ND-filter):

Here is how this first test setup looked like:

All these parameters were calibrated for an afternoon shooting session, but we really started to record in the evening (look at the phone’s clock in the video!). Because of this delay, I lost the white stripe of natural light coming from the top of the background. At the last minute, I started to play with the white balance. Then I changed my mind and removed the ND-filter. And closed the lens to f/3.5 to get a more manageable depth of field. In a word, I messed up all my initial settings resulting in a final video looking worse (in my opinion) compared to my first test. The better is the enemy of the good

But there is something I’m quite happy with from my last minute changes: dimming the phone’s screen brightness. Phone screens are so powerful nowadays that they create clipped highlights, thus reducing the readability of black characters on white background.

Here is a photo of the final setup, in which I marked the focus plan with black electric tape:

As you can see in the final video, I have some aliasing issues due to the pixelated nature of the phone’s screen and the line skipping happening on 7D’s CMOS sensor. I tried to reduce the aliasing by moving the phone to a distance were the natural softness of the Sigma lens will occur. I didn’t really succeed as it’s really hard to maintain a constant distance to the lens while holding the phone by hand.

Yes, I could have tried to put the phone on a stand but I really wanted to show the app on a real phone, into real hands, as to make it clear there was no special effects or compositing in action. The application is real, it’s running on bare metal, it’s not a mockup, showing that Uperto has tough engineers getting things done ! ;)

By the way, about hands: there a trick involved here. The left hand is mine, but the right one is my co-worker’s. There was a big advantage using this technic: with an eye on the 7D’s rear LCD monitor, I can fully concentrate on the image and micro-adjust the distance of the phone to the lens. In the same time, my co-worker can focus (pardon the pun) on the action and follow the script. The only time when you can see my right hand is when I take the Acer Liquid E to demonstrate the propagation of messages via Twitter:

Video editing

For video editing, I knew I’ll not be able to manipulate my 7D’s files natively. At least not with the default packages bundled with my Kubuntu 10.04. So monday morning I started to compile the trunk version of x264, FFmpeg and MLT. Then I realized a brand new version of Kdenlive (v0.7.8) was released. How did I missed such an important news about my favorite NLE ? :) Compliments must go to the Kdenlive team for providing up to date packages and all their dependencies !

So I did the entire video editing with Kdenlive. Here is what the final project looks like in the timeline:

Inter-title cards were created from scratch with Gimp:

Audio

Let’s talk audio now. I personally want to thanks Tomasito, Cool Cavemen’s saxophonist, who lends me his Shure Beta57A microphone and his Line 6 POD Studio UX1 interface for this project. With electrical tape, I attached the microphone on my Gorillapod, which serves as a mic stand. I used this setup to record Arnaud’s voice:

I wanted to record the speach on my linux machine but I didn’t managed to compile the Line 6 open-source drivers. In fact the module compiled but refused to load:

Sep 20 22:02:47 kev-laptop kernel: [  717.905187] line6usb: Unknown symbol snd_rawmidi_receive
Sep 20 22:02:47 kev-laptop kernel: [  717.905321] line6usb: disagrees about version of symbol snd_ctl_add
Sep 20 22:02:47 kev-laptop kernel: [  717.905323] line6usb: Unknown symbol snd_ctl_add
Sep 20 22:02:47 kev-laptop kernel: [  717.905379] line6usb: disagrees about version of symbol snd_pcm_new
Sep 20 22:02:47 kev-laptop kernel: [  717.905380] line6usb: Unknown symbol snd_pcm_new
Sep 20 22:02:47 kev-laptop kernel: [  717.905439] line6usb: disagrees about version of symbol snd_card_register
Sep 20 22:02:47 kev-laptop kernel: [  717.905440] line6usb: Unknown symbol snd_card_register
Sep 20 22:02:47 kev-laptop kernel: [  717.905498] line6usb: disagrees about version of symbol snd_card_free
Sep 20 22:02:47 kev-laptop kernel: [  717.905499] line6usb: Unknown symbol snd_card_free
Sep 20 22:02:47 kev-laptop kernel: [  717.905557] line6usb: disagrees about version of symbol snd_pcm_lib_preallocate_pages_for_all
Sep 20 22:02:47 kev-laptop kernel: [  717.905559] line6usb: Unknown symbol snd_pcm_lib_preallocate_pages_for_all
Sep 20 22:02:47 kev-laptop kernel: [  717.905667] line6usb: disagrees about version of symbol snd_pcm_stop
Sep 20 22:02:47 kev-laptop kernel: [  717.905668] line6usb: Unknown symbol snd_pcm_stop
Sep 20 22:02:47 kev-laptop kernel: [  717.905917] line6usb: disagrees about version of symbol snd_ctl_new1
Sep 20 22:02:47 kev-laptop kernel: [  717.905918] line6usb: Unknown symbol snd_ctl_new1
Sep 20 22:02:47 kev-laptop kernel: [  717.906043] line6usb: Unknown symbol snd_rawmidi_transmit_ack
Sep 20 22:02:47 kev-laptop kernel: [  717.906261] line6usb: disagrees about version of symbol snd_pcm_hw_constraint_ratdens
Sep 20 22:02:47 kev-laptop kernel: [  717.906262] line6usb: Unknown symbol snd_pcm_hw_constraint_ratdens
Sep 20 22:02:47 kev-laptop kernel: [  717.906379] line6usb: disagrees about version of symbol snd_pcm_lib_malloc_pages
Sep 20 22:02:47 kev-laptop kernel: [  717.906381] line6usb: Unknown symbol snd_pcm_lib_malloc_pages
Sep 20 22:02:47 kev-laptop kernel: [  717.906437] line6usb: disagrees about version of symbol snd_pcm_lib_ioctl
Sep 20 22:02:47 kev-laptop kernel: [  717.906439] line6usb: Unknown symbol snd_pcm_lib_ioctl
Sep 20 22:02:47 kev-laptop kernel: [  717.906546] line6usb: disagrees about version of symbol snd_pcm_lib_free_pages
Sep 20 22:02:47 kev-laptop kernel: [  717.906547] line6usb: Unknown symbol snd_pcm_lib_free_pages
Sep 20 22:02:47 kev-laptop kernel: [  717.906617] line6usb: Unknown symbol snd_rawmidi_transmit_peek
Sep 20 22:02:47 kev-laptop kernel: [  717.906771] line6usb: disagrees about version of symbol snd_pcm_set_ops
Sep 20 22:02:47 kev-laptop kernel: [  717.906773] line6usb: Unknown symbol snd_pcm_set_ops
Sep 20 22:02:47 kev-laptop kernel: [  717.906963] line6usb: disagrees about version of symbol snd_pcm_suspend_all
Sep 20 22:02:47 kev-laptop kernel: [  717.906965] line6usb: Unknown symbol snd_pcm_suspend_all
Sep 20 22:02:47 kev-laptop kernel: [  717.907035] line6usb: Unknown symbol snd_rawmidi_new
Sep 20 22:02:47 kev-laptop kernel: [  717.907095] line6usb: disagrees about version of symbol snd_card_disconnect
Sep 20 22:02:47 kev-laptop kernel: [  717.907097] line6usb: Unknown symbol snd_card_disconnect
Sep 20 22:02:47 kev-laptop kernel: [  717.907230] line6usb: Unknown symbol snd_rawmidi_set_ops
Sep 20 22:02:47 kev-laptop kernel: [  717.907413] line6usb: disagrees about version of symbol snd_card_create
Sep 20 22:02:47 kev-laptop kernel: [  717.907414] line6usb: Unknown symbol snd_card_create
Sep 20 22:02:47 kev-laptop kernel: [  717.907474] line6usb: disagrees about version of symbol snd_pcm_period_elapsed
Sep 20 22:02:47 kev-laptop kernel: [  717.907475] line6usb: Unknown symbol snd_pcm_period_elapsed

Against my will, and to not waste time, I resigned myself to use a Windows machine lying around the office. I installed Audacity and the Windows drivers, then plugged the pod. And voilà, I had a portable recording studio.

Again, as we were in a hurry, we didn’t paid close attention to the way Arnaud was speaking in the mic. Thus the quality of the original take was not fantastic. To me it was good enough for the intended purpose.

When I gave the raw recording to Thomas for mixing, he didn’t take long for him to realize how bad we were at recording ! Even without knowing how we proceed to record and what the setup looked like, he pointed out all the stuff we did wrong. I know him for a long time now, but he still amaze me with his technical and practical knowledge about audio stuff. I really want to thanks him for his help on this project !

By the way, if you’re looking to record/mix/master any audio material (from a simple voice-over to a full band), I really recommend you to contact his studio. And tell him you heard of him by reading my blog, he may give you a discount ! ;)

Epilogue

As I concentrated all my efforts towards the creation of the video, I don’t have many details about the application development itself. But coding the android app was, without a doubt, the biggest chunk of work of this project. It involves two of our best Andoid developpers (Jeremy and Paul) and our in-house Photoshop geek for the design. The project was lead by Arnaud.

The whole project was completed in no time and virtually no budget thanks to the dedication and effort of Uperto’s staff. Everybody in Uperto, from management to developpers, was fantastic. It really makes this team unique.

This project was a great oportunity for me to test my video skills. In a sense, it was my first professionnal assignment: I had a limited time, an inflexible deadline and a clear goal. But still, this type of activity falls into my hobby category. I have so much things to learn…

This project is also the first time I edit 1080p footage from my 7D in Kdenlive. This doesn’t mean it’s the first time I shoot with my 7D. In fact I shoot videos in various formats and setup for about a year. But my shooting skills only starts to be acceptable. My other projects involving 7D footages are currently on hold for various reasons (mostly more important stuff to do). That’s why I hadn’t published anything on the web since then. But I expect this situation to change soon ! :D

How-to extract data trapped into an iPhone

After 2 years using an iPhone 3G, it’s time for me to switch to the Android world. My Apple era is over, I need a plateform that is more linux and open-source friendly.

Before erasing and selling my iPhone, I want to backup and extract all the data I produced with it and that is still trapped inside. This mean photos, SMSs, voice messages, safari bookmarks, etc…

There is a nice OSX app simply called iPhone Backup Extractor which let you get these data. Instead of getting data directly from the iPhone, it reads its backups made by iTunes.

So first thing you have to do is to backup your phone using iTunes:

Then you can download and run the iPhone Backup Extractor app:

Here you just have to click the Read Backups button to get a list of all backups available on your machine. Then choose your latest backup:

You’ll get a list of all installed applications on your iPhone. As we are interested in “core” iPhone apps (SMSs, photos and so on), we’ll choose the “iOS Files” item, then choose a place where to extract:

Then the extraction itself will take place:

You’ve just finished the essential part of the process. You now have a nice folder structure containing all the important informations that was trapped in your phone:

Let’s browse the file structure that was just created. You can see photos are available as is, in the /iOS Files/Media/DCIM/XXXAPPLE/:

Most of other datas are located in the /iOS Files/Library/ folder. For example here are voice messages:

Again, .amr files here are playable as-is, like VLC or mplayer.

And finaly most, if not all, other kind of data and metadata are stored in SQLite databases (.db files). The best GUI I found to manipulate with these files under Mac OSX is SQLite Database Browser. See how I can easily extract to a CSV file all metadatas associated with my voice messages:



Ultimate guide of Lotus Notes mail migration

The title may sounds pretentious but extracting mails out of Lotus Notes is soooo hard and complicated, that achieving such a task feels like winning an epic battle against the forces of evil.

Anyway. The goal of this post is to help you migrate all your Lotus Notes mails to a more convenient and standard format like maildir or mailbox.

There are several ways of extracting all your mail trapped in Lotus Notes’ proprietary databases.

Method #1: using integrated IMAP service

This is probably the simplest method. It consists in using the Lotus Notes desktop client (were your emails currently resides) as an IMAP client.

Essentially, what you have to do is just to create a secondary account linked to an IMAP server, like Gmail, etc. This works well and is explained in details in this tutorial.

But sometimes your Notes client is behind firewalls and proxys. So you can’t reach the Internet.

And some other times, Lotus Notes clients are crippled and don’t let you create an IMAP connexion. Unfortunately this happened to me:

So I had to found another approach.

Method #2: using nlconverter

This method is explored in details in my previous article.

But again, it seems that the Lotus Notes on my machine was crippled and/or corrupted. The nlconverter GUI gave me this error:

And the command line gave me this:

Traceback (most recent call last):
  File "notes2mbox.py", line 21, in <module>
    db = NlconverterLib.getNotesDb(notesNsfPath, notesPasswd)
  File "C:\winnlc-alpha-1\NlconverterLib.py", line 43, in getNotesDb
    session = win32com.client.Dispatch(r'Lotus.NotesSession')
  File "C:\Python26\lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch
    dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
  File "C:\Python26\lib\site-packages\win32com\client\dynamic.py", line 104, in _GetGoodDispatchAndUserName
    return (_GetGoodDispatch(IDispatch, clsctx), userName)
  File "C:\Python26\lib\site-packages\win32com\client\dynamic.py", line 84, in _GetGoodDispatch
    IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)
pywintypes.com_error: (-2147221231, 'ClassFactory ne peut pas fournir la classe demand\xe9e', None, None)

After these two failed attempts, I was quite depressed and not far from surrender to the evil power of proprietary software. Then I managed to setup a new (but complicated) strategy.

Method #3: using Lotus Notes client for Mac OS X

This is the only method that worked for me, and basically, is the same as the first one, but on Mac OS X. Additionally, it involves a local mail server. This procedure was tested several times on Leopard (OSX 10.5).

  1. First things first, download the trial version of Lotus Notes client for Mac OS X (unfortunately you have to register) and install it. I used Lotus Notes 7.0.3 for Mac OS X Leopard (10.5):
  2. You’ll be welcomed by a wizard:
  3. On the next screen, enter a dummy name and uncheck the “I want to connect to a Domino server” box:
  4. Then proceed to the next step in which you’ll uncheck “Setup instant messaging“:
  5. In the last screen, uncheck all boxes. We don’t want to setup any other service yet:
  6. Initial setup is now complete:

    You can now launch Lotus Notes:

  7. On first run, there will be the following screen, where you should click on the “No thanks, just give me the defaults“:
  8. You’ll end up on what will be your default Lotus Notes main page from now on:
  9. The next step is to go back to the machine (Windows for me) from which you’re running the Notes client containing all the mails you plan to migrate. From there, export your mail database:

    All details of this operation can be found in this dedicated article.
  10. Then go back to your Mac OS X machine and import your freshly exported .nsf database. This is as simple as opening the file via the File > Database > Open... menu and dialog:

  11. When Notes attempts to open the file, you’ll be prompted by several dialogs regarding the security attached to the database. If you get the “Create Cross Certificate” screen, then just answer “Yes” as below:

    And every time you get an “Execution Security Alert” message, always check the “Start trusting the signer to execute this action” option before clicking “OK“:
  12. The client will then rebuild the index before giving you a plain view of your inbox:

  13. Next step is to setup a local IMAP server:

    As you can see I used Dovecot, and all is explained here.
  14. Now it’s time to create a new account in Lotus Notes to access this local IMAP server. Click on the Address Book in your toolbar and add a new Account:

  15. Here is where you configure Notes to let it be aware of our local server existence. Only the first tab must be changed to your local parameters. You can left the last two tabs untouched:
  16. Open within Notes your local IMAP mailbox. It is found in the workspace, which you can access via the Databases icon on your toolbar:

  17. You’ll be welcomed by a useless help screen:

    Just close it to get your local IMAP mail view:
  18. While trying to opening the local IMAP mailbox, you may encounter this TCPIP port error:

    In this case, please have a look at my other article explaining how to open TCPIP port in Lotus Notes.
  19. For this step, just copy or cut, then paste, mails from your local .nsf database to your local IMAP account:




  20. While playing with copy’n'paste, you may encounter this error:

    A workaround can be found in this article.
  21. Finally, if like me you’ve played a lot with mails during the transfer step above, you may ends up with loads of duplicate mails. In this case have a look at the deduplication script I wrote. It will help you clean-up your Maildir folder.
  22. That’s it ! You now have a standard Maildir of your Lotus Notes mails, located in your user home directory (~/Maildir):

My ultimate action was to convert the Dovecot maildir to Kmail maildir, as I wanted to use Kmail to finally upload everything in Gmail. But you can use anything that suit your needs, like thunderbird or any mail conversion tools.

Conclusion

  • Lotus Notes sucks. Everybody knows that, but I feel liberated saying that ! ;)
  • The smartest thing to do is to avoid Notes like the plague in the first place. Sadly when working for the man, it’s not always possible… :(
  • The only method I found to work for me (the third solution in this article) is far from perfect from my point of view. What I dream about is a 100% automated solution, like a command line utility we can name nsf2maildir. And as I don’t plan to own Apple hardware and software in a near future, such a command should be 100% free software and running on Linux. I really think there is a “market” for a free software component able to read and understand .nsf files. Any motivated volunteer ? ;)

Convert Lotus Notes’ nsf files to mbox with nlconverter

There is a great piece of software called nlconverter. It’s a tool designed to convert Lotus Notes’ .nsf files to mbox. It rely on win32′s COM/DDE API so it can only be used on Windows.

If you want to extract mails out of your .nsf database, this might be the tool you’re looking for. Bonus point: it’s written in Python ! ;)

Installing nlconverter and its dependencies

Here is how I installed nlconverter on a Windows 2000 (SP4) machine:

  1. First I downloaded and installed the official Python builds for Windows (2.6.6 precisely):




  2. Then Python for Windows extensions (build 214 for Python 2.6 in my case):



  3. Finally I had to download the latest icalendar archive, then extract the \iCalendar-1.2\src\icalendar folder to C:\Python26\Lib\site-packages\:
  4. Next step is to download nlconverter itself and extract it:

nlconverter GUI

First thing you have to do is to create an export of your mails as a .nsf database. Follow the previous link to get the instructions.

Now let’s convert this nsf to a mbox. nlconverter’s FAQ tells you to run the gui.exe program to perform the conversion.

Unfortunately it didn’t work for me:

So I tried the alternative approach by using the command line.

nlconverter command line

Again, most of the things I’m writing here are based on nlconverter’s FAQ:

  1. First, we have to download the notes2mbox.py script from nlconverter’s mercurial repository, as this file is not distributed in the winnlc-alpha-1.zip archive I unzipped previously. Let’s put notes2mbox.py in C:\winnlc-alpha-1\:
  2. Now we’ll modify the notes2mbox.py script to set the password (via the notesPasswd variable) and location (notesNsfPath variable) of the .nsf file. Here are the modifications I applied:
    --- notes2mbox.py.orig	2010-09-02 13:49:58.000000000 +0200
    +++ notes2mbox.py	2010-09-02 13:51:24.000000000 +0200
    @@ -14,8 +14,8 @@
     import NlconverterLib
    
     #Constantes
    -notesPasswd = "foobar"
    -notesNsfPath = "C:\\archive.nsf"
    +notesPasswd = "XXXXXXXXXXXXX"
    +notesNsfPath = "C:\\winnlc-alpha-1\\kevin-notes-big-backup-part-1.nsf"
    
     #Connection à Notes
     db = NlconverterLib.getNotesDb(notesNsfPath, notesPasswd)
    
  3. Before running the script, we have to register a Notes DLL used by nlconverter:
    regsvr32 "C:\Program Files\Notes\nlsxbe.dll"
    


    And make the Python interpreter available system-wide:

    C:\winnlc-alpha-1>SET Path=%Path%;C:\Python26
    
  4. Now we can run the notes2mbox.py script:
    C:\winnlc-alpha-1>C:\Python26\python.exe notes2mbox.py
    

If you’re lucky, you’ll get a nice mbox at the end of the process.

But I was not and the notes2mbox.py ended up with the following error:

Traceback (most recent call last):
  File "notes2mbox.py", line 21, in <module>
    db = NlconverterLib.getNotesDb(notesNsfPath, notesPasswd)
  File "C:\winnlc-alpha-1\NlconverterLib.py", line 43, in getNotesDb
    session = win32com.client.Dispatch(r'Lotus.NotesSession')
  File "C:\Python26\lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch
    dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
  File "C:\Python26\lib\site-packages\win32com\client\dynamic.py", line 104, in _GetGoodDispatchAndUserName
    return (_GetGoodDispatch(IDispatch, clsctx), userName)
  File "C:\Python26\lib\site-packages\win32com\client\dynamic.py", line 84, in _GetGoodDispatch
    IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)
pywintypes.com_error: (-2147221231, 'ClassFactory ne peut pas fournir la classe demand\xe9e', None, None)

As you can see, I tried hard to make nlconverter working, without any success. But this should not stop you to try. In fact I suspect the Lotus Notes installed on my machine to be crippled or corrupted (can’t really tell). So you may be more lucky than me. In any case, feel free to report any success or failure in the comment section below !