Video processing now makes use of a json file to pass meta info about the video to be processed. Of interest is method used to note the race start which can be one of 5 options, the simplest just being the video start. Previously meta info for the recorded video finish of a race was passed as embellishments of the video filename and then parsed at this end. This was not very robust and could lead to errors if the filename was not constructed correctly. Preceding the download of the video, the json file is sent from the phone and relevant metadata is extracted from the JSON file, such as the video filename, video start method, the video wall clock start time and the race start wall clock time.

Wall clock time is the calendar date and actual time of day, which is a C# DateTime object

The Code Repository

See AthStitcher app code repository here: djaus2/PhotoTimingDjaus on GitHub.

The code repository contains a number of videos in the vid directory, all copied from the same original video recording of a sprint finish. A copy was created for each of the StartFrom options and the filename was modified with ancillary information such as the video start time. The WPF app (AthStitcher) orignially parsed the filename to get the meta-info. This is now passed in a json file so there is no need to embellish the filename. Two of the example videos do retain the filename embellishment.

Video Race Start Options

These are defined as enums in the code:

    public enum TimeFromMode
    {
        FromVideoStart, //From start of video capture
        FromGunSound, //From gun sound
        FromGunFlash,  //From observed flash of gun on video
        ManuallySelect, //Manually selected start time
        WallClockSelect
    }

The various start methods are enable the race state to be noted in a number of ways providing flexibility for lower level athletic events.

About the Sample Videos

These videos are in the vid directory of the code repository. The videos are all copies of the same sprint finish video but with different start methods: vid folder

The simplest video is fromvideostart.mp4 which uses the elapsed video time as the race time for finishers. The second simplest start method is manual.mp4 where the viewer pick a suitable time on the stitched image by clicking on the image. The fromgun.mp4 video has a gunfire added at 2 seconds for the start of the video. The AthStitcher can correctly discern this as the (fictitious) race start. (There is also an embellsihed filename version of this video) fromgun_GUNSOUND_.mp4 which does not need a json file). The fromflash.mp4 has a video frame that is black then a completely white frame at 2 seconds to simulate the start of the race. The AthStitcher can also correctly discern this as the race start. There is also a filename embellished version of this video fromflash_FLASH_.mp4 which does not need a json file. With these two embellished videos, the meta-info is parsed from the filename and a new copy of the video is used that has the embellishments removed. wallclock.mp4 passes the wallclock times of both the video start and the guntime which are then used to deteremine the guntime wrt the video start and hence to calculate actual race finish times.

Video Start Time: This is the actual wall clock time when the video recording started. In copying and transmitting the videos it was found that getting the file creation time was not reliable as this could be changed by copying the file etc. The video start time is noted at the start of the video recoring and this is passed in the json file.

Similarly, the WallClock Guntime is the actual wall clock time when the gun is fired and can be provided in a number of ways. It can be before or after the video start.

To view the sample fromvideostart video click here:fromvideostart.mp4

Stitched Images

fromvideostart.png

Comment: Ideally the lane area should be all white as it would be with a professional system. The finish line is white with black where the lanes pass through it. The image is stitched together by taking the middle vertical line from each video frame. Due to the phone only being hand held, the middle vertical ine of the video frames is not always exactly aligned with start line. This does not impact the timing though. Each vertical line image has a corresponding video frame. Both have the same time property. The frame corresponding to a vertical line can be shown and inspected to make an accurate decision as to when an athlete actually crosses the finish line.

In the image you can see the athletes crossing the finish line. The faster they are running, the less video frames they show up in and the narrower their image when finishing. As indicated the video frames about these traces in the image can be inspected to make an accurate time decision. In this image 2 athletes cross the finish line together first, (first on left) then 3 others cross at later times. The times are calculated from the video start time and the elapsed time of the corresponding video frame.


 TopicSubtopic
   
 This Category Links 
Category:Application Dev Index:Application Dev
<  Prev:   Aberfeldie Masters Athletics