Skip to content

Commit

Permalink
added additional time reading format
Browse files Browse the repository at this point in the history
  • Loading branch information
dvida committed Apr 24, 2024
1 parent a264b41 commit 0e12907
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions RMS/Formats/FrameInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,15 +718,20 @@ def __init__(self, dir_path, config, beginning_time=None, detection=False):

if beginning_time is None:

# Try reading the beginning time of the video from the name if time is not given
try:
# Try reading the beginning time of the video from the name if time is not given
self.beginning_datetime = datetime.datetime.strptime(file_name_noext, "%Y%m%d_%H%M%S.%f")

except ValueError:

except:
messagebox(title="Input error", \
message="The time of the beginning cannot be read from the file name! Either change the name of the file to be in the YYYYMMDD_hhmmss format, or specify the beginning time using command line options.")
try:
self.beginning_datetime = datetime.datetime.strptime(file_name_noext, "%Y%m%d_%H%M%S")

sys.exit()
except:
messagebox(title="Input error", \
message="The time of the beginning cannot be read from the file name! Either change the name of the file to be in the YYYYMMDD_hhmmss format, or specify the beginning time using command line options.")

sys.exit()

else:
self.beginning_datetime = beginning_time
Expand Down

0 comments on commit 0e12907

Please sign in to comment.