-
Notifications
You must be signed in to change notification settings - Fork 12
Description
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