Timelapse: 3. Video Production

Tuesday, December 29, 2015

This is the final blog in the series on producing an inset map for a timelapse video (see also Geocoding and Map Production).

OK, so we now have all the photos time synced and geotagged, and produced the actual overlay of the route and current position on an inset map. The last stage is to render each photo with timestamps and location map and then produce the video.

Software

NConvert (as a command line programme you can use it in batch files)
XNConvert
Mencoder

1. Resize PNG

Resize the inset map PNGs so that they are the right size for the video you are producing. My photos were 500×666 (near DVD quality), and so I resized the inset map to 150×150 using NConvert:

nconvert -out png -resize 150 150 -overwrite *.png

2. Time Stamp Overlay

NConvert is meant to be able to do this step, but after several queries in the support forums it looks like the functionality hasn’t been added. Whilst in my earlier blog post I used XNView to add the metadata overlay, this can be performed used XNConvert which is just easier and more flexible for batch processing files. You can happily save the process you have created to reload it later on and also convert the process to an NConvert command (although it doesn’t support all commands yet).

I added the “Durness to Dover” strap line as one action and then the time stamp as another action. The formatting for the latter is of the form:

Day 01: {EXIF:Date [H:M]}

which ensures that only the hour and minute display. The font and position is fully configurable so experiment a little to make sure it’s what you want. XNConvert (helpfully) has a preview panel so you can see what it will render like.

3. Inset Map Overlay

The final set of photos takes the output produced in step 2 (the time stamp) and overlays the map on to it. For this I used NConvert again, however in this instance the command is more complex because for each input photo I want the matching inset map (which has the same name). NConvert doesn’t allow you to do this (it assumes just one overlay image) so some DOS batch processing was needed. I blogged about this a few weeks back (read that post to understand the command) and this easily solves the problem:

for /f %a IN (’dir /b *.jpg’) do ..\..\nconvert -out jpeg -wmflag bottom-right -wmfile overlay\%~na.png -o final\%~na.jpg %~na.jpg

The actual NConvert command is very simple, just placing the listed image in the bottom right corner and then outputting a new file.

3. Render MJPEG

This now uses Mencoder to produce the final MJPEG and is uploaded to YouTube to produce the mp4. You can then download this file for distributing to people. Just as a reminder (from this blog) the command is:

mencoder “mf://@list.txt” -mf fps=3 -o test.avi -ovc lavc -lavcopts vcodec=mjpeg:vbitrate=1600 vqmin=3

Remember that you will need to create the list.txt file to feed the input files in to Mencoder. Also remember to change the “fps” setting as this is the frames per second so depending what rate your camera was set at, this will need to change.

Below is a reminder of the final product. Phew!! All of this, bar the use of XNConvert could be batch processed making it a rapid process.

Add comment

Fill out the form below to add your own comments