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

Documentation Request: 'still()' Filter's Frame Position Functionality in Thumbor Video Engine #17

Open
pfcodes opened this issue Jul 16, 2023 · 0 comments

Comments

@pfcodes
Copy link

pfcodes commented Jul 16, 2023

I'm currently working on a project that involves extracting specific frames from videos using the Thumbor Video Engine. While reading through the source code, I noticed the still() filter appears to support a position parameter (i.e., still_position), allowing the extraction of a specific frame based on a timestamp. However, this functionality is not currently documented in the official Thumbor or Thumbor Video Engine documentation.

Here is a snippet from the source code indicating this functionality:

@filter_method(r'(?P<pos>\-?(?:(?:\d\d:)?\d\d:\d\d(?:\.\d+?)?|\d+(?:\.\d+?)?))')
def still(self, position='0'):
    logger.debug('Setting still frame at position %s' % position)
    self.context.request.still_position = position
    return filter_retval()

And its application in the Engine class:

still_frame_pos = getattr(self.context.request, 'still_position', None)
# Are we requesting a still frame?
if self.engine is self.ffmpeg_engine and still_frame_pos:
    with named_tmp_file(data=buffer, suffix=extension) as src_file:
        buffer = self.ffmpeg_engine.run_ffmpeg(
            src_file, 'png', ['-ss', still_frame_pos, '-frames:v', '1'])

I've tested this feature, and it appears to be working as expected. However, the lack of documentation could cause confusion for others utilizing the still() filter in the future.

I would like to suggest adding this detail into the official documentation to help clarify the full functionality of the still() filter in Thumbor Video Engine.

-- ChatGPT generated message

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

No branches or pull requests

1 participant