User Tools

Site Tools


atmos:software:virtualdub

Timestamping videos from Spring09 Saudi campaign

First of all, we need a Win system and the following tools must/should be obtained: (Get them using the links provided in the bottom of the page or look under /nas/software/virtualdub)

  1. Virtualdub-MPEG2 [1]
  2. Add Frame Numbers (Virtualdub filter) [2]
  3. Virtualdub [3]
  4. GSpot [4]
  5. MOIRead [5]
  6. ffdshow [6]

MOD (MOvie Data) and MOI (MOvie Information) files are transferred from the camera. (need brand and model information here). MOD files simply contain video data and could be played by changing their extension to mpg. (Using GSpot codec information tool it is seen that they are indeed MPEG2 video encoded.) MOI files contain important information (eg. timestamp, movie-length etc.) regarding to the data files come with them. These files either can be viewed a hex-mode supported text editor (eg. GVIM) or using the MOIRead tool. Using MOIRead tool it is very easy to obtain file-creation stamp of a video file. Make sure that the files are following each other in a consistent order (ie. mov001.mod, mov001.moi)

(For demonstration I use a small video file from one of the recordings. The same technique can be applied to other files but one must give great attention while obtaining the time-stamps from MOI files since the camera time wasn't always synchronized with the M300 system time. Wrong timestamping will defeat the purpose of matching the video data with the other measurements.)

First extract Virtualdub-MPEG2 to a folder and extract the file addframenumber.vdf from Add_Frame_Numbers_0.6.1.zip into the plugins folder. Start the program and load a mpg file from the videos.

Figure 1. VirtualDub screen showing the input video on the left and output on the right panel.

Now go Video→Filter→Add and choose AddFrameNumber…

Figure 2. Add Frame Number / Timestamp plugin activated.

We have to fill out the Time and Date values correctly. For this start MOIRead and obtain information of the mov001.moi file by using this utility.

Figure 3. Start Date: 2009-3-19 and Time:22:14:13 (Time field looks suspicious because it is late at night according to this stamp however the movie obviously show that this was a day flight. For the example I will use this information, but this is not the right time-stamp that should be overlaid onto the video.)

After filling out this information

Figure 4. Timestamp information filled. Bigger font-size look more readable while viewing the videos.

You can play with the slider to see the effects of the filter. The next step is to saving the filtered video. Although it is not necessary it is wise to use a high-compression high-quality codec such as (H264) to encode the video. H264 and many other codecs will come with the installation of the ffdshow [6]. Now go to Video→Compression and select ffdshow Video Codec and launch its configuration window and select H.264 as encoder. (Feel free to test other codecs same for video compression.)

Figure 5. We are using H.264 codec in this demonstration and leaving all other options as default.

Once after setting these options go to File→Save as AVI and wait for the operation to finish. (Some video files are huge (>2GB) and could take long time to be saved in new format.) With these settings the original movie file (mov001.mpg ~ 29.1 MB is shrunk to 7.67MB without a visible and audible loss. These three files (mov001.mod, mov001.moi, mov001.avi) have been put under /nas/software/virtualdub/ folder) You can try KMPlayer [7] to view the videos.

<html> <span style=“color:red;font-size:150%;”>UPDATE: (January 06, 2010)</span> </html> H264 encoding has a glitch while viewing the videos embedded with timestamps. That is the timestamp counter starts counting with 1-2 seconds delay. Therefore it is recommended to use XviD codec from the ffdshow configuration window for video compressor. The new file mov001_xvid.avi is almost the same size (7.74 MB) with h264 encoding. Additionally, using XviD codec eliminates another glitch that appears while the video file is cut via Virtualdub [3]. With XviD the timestamp is preserved and displayed correctly. To see the result look mov001_xvid_cut.avi under /nas/software/virtualdub.

Notes for the future video recordings

- Always time-synchronize the camera and M300 recording system before starting the video recording.

- Always save the videos right after each flight and manually time-stamp the videos using the described technique.

- Some MOI files are 0-sized. This must be checked carefully while transferring the files.


[1] http://www.videohelp.com/tools/Virtualdub-MPEG2

[2] http://www.hlinke.de/vdub-filter/Add_Frame_Numbers_0.6.1.zip

[3] http://www.videohelp.com/tools/Virtualdub

[4] http://www.videohelp.com/tools/GSpot

[5] http://www.iol.ie/~geniet/eng/moihelp.htm

[6] http://www.videohelp.com/tools/ffdshow

[7] http://kmplayer.en.softonic.com/

atmos/software/virtualdub.txt · Last modified: 2020/01/29 17:25 by 127.0.0.1