-
Notifications
You must be signed in to change notification settings - Fork 18
Add default recording directory to recording tools #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
python/cli/record/oak.py
Outdated
if args.auto_subfolders: | ||
import datetime | ||
autoFolderName = datetime.datetime.now().strftime("%Y%m%dT%H%M%S") | ||
autoFolderName = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the Python recording tool's datetime -> string formatting a little (to match other wrappers). Or do you prefer the old version, and I should use that in the other wrappers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. The old format is the standard ISO8601 datetime format and can be parsed in many programming languages with some method that mentions that identifier (it can also optionally handle time zones etc. unambiguously). However, the proposed format is easier to read (by humans) and I think this is more relevant in this context.
else if (argument == "--auto_subfolders") | ||
autoSubfolders = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the automatic creation of timestamped folders is the most commonly desired mode of operation, so it's a bit awkward that you need to set this parameter to get that behavior. Instead, the argument could be removed by making it work like this:
- If
recordingFolder
is set, record to that directory without any subfolders (overwrites if run twice). This allows the user to save data exactly where he wants, as he can create the parent folder himself. - If
recordingFolder
is not set, save indata/%Y-%m-%d_%H-%M-%S
. It probably does not matter much that the user can't set name of the parent folder, but you could also add an optional argument to set that path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it works like this:
If --output
is set, then recordings are saved to output
If --output
is not set, then recordings are saved to data/timestamp
(default)
If --output --auto_subfolders
is set, then recordings are saved to output/timestamp
Tested on Ubuntu 20.04 LTS with OAK-D (Python), Orbbec Femto Mega and Azure Kinect.