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

Extend image_name_template to allow timestamp #394

Open
Veldhoen opened this issue Apr 26, 2024 · 1 comment · Fixed by #395
Open

Extend image_name_template to allow timestamp #394

Veldhoen opened this issue Apr 26, 2024 · 1 comment · Fixed by #395

Comments

@Veldhoen
Copy link

Veldhoen commented Apr 26, 2024

Problem/Use Case

The current implementation for image_name_template allows four placeholders (of which FRAME_NUMBER is not described in the documentation).

                    VIDEO_NAME=video.name,
                    SCENE_NUMBER=scene_num_format % (i + 1),
                    IMAGE_NUMBER=image_num_format % (j + 1),
                    FRAME_NUMBER=image_timecode.get_frames()), image_extension)

In our use case, we would like to use the image timstamp in the filename, to be able to directly match the image with the right location in the video. Specifically, we would like to use the timestamp as in milliseconds from start, so we can use integers to refer to them.

Proposed Implementation:

In terms of implementation, it is pretty trivial to add this option just by adding
FRAME_TIMESTAMP_MS = int(image_timecode.get_seconds()*1000). (using FrameTimeCode.get_seconds)

To enable users to use this, all that needs to be done is extend the documentation specifying $FRAME_TIMESTAMP_MS as one of the template options.

@Breakthrough
Copy link
Owner

Breakthrough commented Apr 27, 2024

Thank you for the suggestion and PR,. Note that I will likely rename the variable to $TIMESTAMP_MS (just shorter to type) in the next official release, so if you depend on this you may want to update your PR and use cases accordingly.

I'd also like to add $TIMECODE as well before closing this out. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants