Fix a bug where finish range is wrong if start range doesn't start at 0

It was in the wrong direction so eg. starting 10sec early caused finish to be 20sec late
condor-scripts
Mike Lang 3 years ago
parent c9003fd540
commit c1465f49a6

@ -149,7 +149,7 @@ def main(match_id, race_number,
print "Cutting file {} for manual detection.".format(start_path)
cut_to_file(start_path, base_dir, racer, start_start, start_end, frame_counter=True)
time_offset = float(raw_input("What timestamp of this video do we start at? "))
time_offset = datetime.timedelta(seconds=time_offset)
time_offset = datetime.timedelta(seconds=start_range[0] + time_offset)
# start each racer's finish video at TIME_OFFSET later, so they are the same
# time since their actual start.

@ -174,7 +174,7 @@ def review(
black_end = line.split(' ')[4]
assert black_end.startswith('black_end:')
time_offset = float(black_end.split(':')[1])
time_offset = datetime.timedelta(seconds=time_offset - start_range[0])
time_offset = datetime.timedelta(seconds=start_range[0] + time_offset)
# start each racer's finish video at TIME_OFFSET later, so they are the same
# time since their actual start.

Loading…
Cancel
Save