-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
timestamp extraction and notes correction
- Loading branch information
1 parent
5312da8
commit 28e5023
Showing
2 changed files
with
13 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,28 @@ | ||
import cv2 | ||
|
||
from pathlib import Path | ||
from datetime import datetime | ||
|
||
|
||
def print_video_info(videos_path: Path): | ||
for video_path in videos_path.iterdir(): | ||
if video_path.suffix not in {".avi", ".AVI", ".mp4", ".MP4"}: | ||
continue | ||
print(f"video name: {video_path.name}") | ||
starting_timestamp = video_path.stem.split("__")[-1] | ||
starting_datetime = datetime.fromisoformat(starting_timestamp) | ||
print(f"starting datetime: {starting_datetime}") | ||
cap = cv2.VideoCapture(str(video_path)) | ||
print(f"frame count: {cap.get(cv2.CAP_PROP_FRAME_COUNT)}") | ||
print(f"fps: {cap.get(cv2.CAP_PROP_FPS)}") | ||
cap.release() | ||
|
||
|
||
if __name__ == "__main__": | ||
folder_path = Path("/Users/philipqueen/Documents/Humon Research Lab/Basler Stuff/calibration_attempt/") | ||
folder_path = Path( | ||
"/Users/philipqueen/Documents/Humon Research Lab/Basler Stuff/calibration_attempt/" | ||
) | ||
raw_videos_path = folder_path / "raw_videos" | ||
synched_videos_path = folder_path / "synched_videos" | ||
|
||
print_video_info(synched_videos_path) | ||
print_video_info(synched_videos_path) |