Video synchronization software
==============================

This software finds synchronization between two videos and outputs it in a text file. 
Use:

videomatcher -r <reference-input> -q <query-input> [--auto]
videomatcher --merge-to <output sequence> <input sequence 0> ... <input sequence N>

For example:

videomatcher -r Hollywood2\AVIClipsScenes\sceneclipautoautotrain00219_perturbed2.mkv \
	-q Hollywood2\AVIClipsScenes\sceneclipautoautotrain00219.avi

synchronizes two videos from the Hollywood2 dataset. Specifying also the [--auto] flag
uses the more precise autocorrelation unbiasing method.

The input or output videos can be accompanied by a cue sheet to select only a part
of the video to be synchronized, for example:

	15UNIS-Outdoor-BUT-05.txt*15UNIS-Outdoor-BUT-05.m4v*walk_2l1r*0

uses the cue-sheet 15UNIS-Outdoor-BUT-05.txt, video file 15UNIS-Outdoor-BUT-05.m4v
and selects the action walk_2l1r with index 0 (if the action is repeated, the index
can be used to select the desired repetition).

The cue-sheet file can look like this:

time-start,time-end,action-id
00:00:00,00:00:16,round_pitas
00:00:16,00:00:28,phone_pitas
00:00:35,00:00:50,round_pitas
00:00:51,00:01:08,round_pitas
00:01:09,00:01:25,round_pitas
00:01:27,00:01:38,phone_pitas
00:01:39,00:01:44,walkback_pitas
00:01:46,00:01:57,phone_pitas
00:01:58,00:02:06,walkback_pitas
00:02:06,00:02:18,phone_pitas
00:02:24,00:02:32,gunfire_pitas_photobombed
00:02:32,00:02:40,walkfwd_pitas_photobombed
00:02:44,00:02:53,gunfire_pitas
00:02:53,00:02:59,walkfwd_pitas
00:02:59,00:03:09,gunfire_pitas
00:03:09,00:03:15,walkfwd_pitas
00:03:15,00:03:25,gunfire_pitas
00:03:25,00:03:30,walkfwd_pitas
00:04:23,00:04:38,round_lady_r
00:04:40,00:04:58,round_lady_r
00:05:00,00:05:16,round_lady_r
00:05:41,00:05:48,phone_lady_r
00:06:00,00:06:08,phone_lady_r
00:06:08,00:06:15,walkback_lady_r
00:06:15,00:06:24,phone_lady_r
00:06:24,00:06:31,walkback_lady_r
00:06:31,00:06:39,phone_lady_r
00:07:01,00:07:08,gunfire_lady_r
00:07:09,00:07:14,walkfwd_lady_r
00:07:14,00:07:20,gunfire_lady_r
00:07:21,00:07:25,walkfwd_lady_r
00:07:31,00:07:37,gunfire_lady_r
00:09:23,00:09:30,walk_2l1r
00:09:31,00:09:38,walk_1l2r
00:09:48,00:09:55,walk_2l1r
00:09:56,00:10:04,walk_1l2r

Once ran, the synchronization metadata is saved to [sequence name]_sync_info.txt and
the synchronized video frames are written to the framedump folder. These can be later
encoded to a video.

In order to paste multiple video frames side by side, the

videomatcher --merge-to <output sequence> <input sequence 0> ... <input sequence N>

command can be used. Note that the <output sequence> needs to have a "#0Nd" format
marker inside where N is the number of digits of frame index in the file name, e.g.:

videomatcher --merge-to lady_r_round_merged_#05d.png round_lady_r-2__frame round_lady_r-1 round_lady_r-0__frame

This then finds all the frames of the specified sequences and puts them side by side.
Note that the sequences do not need to have the same lenght.
