Overview

The Sony XR200 camera is able to include GPS location data in its video recordings. Normally, this information is only visible when playing back the video in the camera itself. Even then, its not possible to view it at the same time as the time of day data - you need to select one or the other.

If the camera video data is transferred to a computer via the USB port, the GPS data is "lost". Computer video players capable of replaying the .MTS video streams only show the time of day data; there is no way to view the GPS data.

Ideally we want to be able to display the time of day and GPS informations simultaneously with the video stream itself.

We describe here how to extract all the required data from an MTS format video stream file and then overlay the information over a replay of the of the video file.


Method

We assume the camera data has been transferred to computer via the camera's USB connector, resulting in a directory containing a number of video clip files with an .MTS suffix e.g. 00000.MTS, 00001.MTS, 00002.MTS etc.

We previously used  Phil Harvey's exiftool application to extract the GPS and other data from the video files. For reference, that previous method is described here. The previous method can take a long time to run. On a 2GB video file (the maximum produced the Sony XR200 camera), the data extraction can take about an hour - the exact time taken will depend on the machine being used.

We now use a C application, avchd2srt-core which extracts the GPS data and simultaeously generates a subtitle file which video players such as mplayer can use to display as text over the video stream. A 2GB video file is now processed in 30-40 seconds!

We create a subtitle file from a video file named, say, 00000.MTS by running the command:
    avchd2srt-core 00000.MTS
   
This generates a file named 00000.srt in the same directory as the MTS video file.

To display the subtitle data over the video, simply run:
    mplayer -demuxer lavc -sub 00000.MTS
(if the .srt file is in the same directory as the .MTS file, mplayer will find and use it)


Issues
    Where is this avchd2srt-core application?
    The original is here but an our updated version is here.

    What about doing this on a Mac?
    It is possible - see details of our own avchd2srt here.

    Could we extract an individual image file that corresponds to an entry in the .srt file?
    See the details of howto relate entries in the .srt file to image files extracted from the video file.

Contact
    Please send any questions, comments, advice etc., to Chris Willing <c.willing _at_ uq.edu.au>