I want to enhance depthai_demo.py to automatically save output video files with customised filenames that correspond to the date and time of the file being saved.
Saving video output with custom filename is date and time of saving video file
Hi chandraj
Create a callback in the demo file like specified here (https://docs.luxonis.com/en/latest/pages/tutorials/depthai_demo/#customize-the-demo-code). I guess onNewFrame makes the most sense for saving video.
import datetime
# When you are ready to save the output file, use something like this:
timestamp = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
filename = f"output_{timestamp}.mp4" # or any other file format you are using
Then save write frames to a directory of your choosing. You might want to just use the SDK functionality for recording (https://docs.luxonis.com/projects/sdk/en/latest/features/recording/).
Thanks,
Jaka