Skip to content
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

Segment timestamp #479

Merged
merged 1 commit into from Jul 20, 2018

Conversation

Projects
None yet
3 participants
@JamesH65
Copy link
Collaborator

commented Jul 20, 2018

Option to specify timestamp in the segment filename

In segmented mode, this allows you to specify that the file
name for each segment uses a timestamp, not a segment number.
Activated using %s instead of %d in the filename.

@6by9
Copy link
Contributor

left a comment

Two reservations.

Firstly I don't believe clock_gettime(CLOCK_REALTIME) adjusts for time zones or similar. Needs confirmation. I've normally seen t=time(NULL); tmp=localtime(&t) when reading the system time.

Secondly we may as well support strnftime to allow the user to specify how they want the time represented, although that may preclude adding msec values.
Flip it around to strstr for %u or %d and use segmentNumber if so. Otherwise pass the string into strnftime

@JamesH65

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 20, 2018

CLOCK_REALTIME appears to be wall clock time, and I think is adjusted as such i.e. uses timezones.

@kukabu

This comment has been minimized.

Copy link

commented Jul 20, 2018

CLOCK_REALTIME returns UTC time

@JamesH65 JamesH65 force-pushed the JamesH65:segment_timestamp branch from c2372ec to 5ff8a63 Jul 20, 2018

@JamesH65

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 20, 2018

OK, l have updated significantly as suggested by 6by9, now used strftime to format the string which gives endless combinaison of exciting filenames. However, you don't get the formatters %d or %u as they are used to detect if you want segment numbers.

Option to specify timestamp in the segment filename
In segmented mode, this allows you to specify that the file
name for each segment uses a time based filename, not a segment
number based one.
If the filename contains %d or %u a segment number is used.
Anything else, and the filename string is used as a formatting
string for the strftime function.

@JamesH65 JamesH65 force-pushed the JamesH65:segment_timestamp branch from 5ff8a63 to 8dd6e4e Jul 20, 2018

@6by9

This comment has been minimized.

Copy link
Contributor

commented Jul 20, 2018

I'm good with that.

@JamesH65 JamesH65 merged commit 11694ef into raspberrypi:master Jul 20, 2018

popcornmix added a commit to raspberrypi/firmware that referenced this pull request Jul 30, 2018

kernel: Bump to 4.14.58
kernel: overlays: Fix vc4-kms-kippah-7inch

kernel: dwc-otg: FIQ: Fix bad mode in data abort handler
See: raspberrypi/linux#2450

bootcode: Re-enable the pull down on SD CLK pin immediately.

firmware: Rawcam: Fixup buffering issues on fast fps

firmware: MMAL alignment changes, plus a couple of minor fixes

userland: Raspicam annotate updates and hello_encode fixes
See: raspberrypi/userland#481

userland: Raspicam: Segment timestamp
See: raspberrypi/userland#479

userland: Raspicam: Two more Raspicam fixes
See: raspberrypi/userland#478

userland: Raspicam: Raspicam Tweaks
See: raspberrypi/userland#477

userland: Raspicam: Fixed up initial timelapse delay
See: raspberrypi/userland#476

popcornmix added a commit to Hexxeh/rpi-firmware that referenced this pull request Jul 30, 2018

kernel: Bump to 4.14.58
kernel: overlays: Fix vc4-kms-kippah-7inch

kernel: dwc-otg: FIQ: Fix bad mode in data abort handler
See: raspberrypi/linux#2450

bootcode: Re-enable the pull down on SD CLK pin immediately.

firmware: Rawcam: Fixup buffering issues on fast fps

firmware: MMAL alignment changes, plus a couple of minor fixes

userland: Raspicam annotate updates and hello_encode fixes
See: raspberrypi/userland#481

userland: Raspicam: Segment timestamp
See: raspberrypi/userland#479

userland: Raspicam: Two more Raspicam fixes
See: raspberrypi/userland#478

userland: Raspicam: Raspicam Tweaks
See: raspberrypi/userland#477

userland: Raspicam: Fixed up initial timelapse delay
See: raspberrypi/userland#476
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.