From dbc0d352a2c41bc9be24e163b962531ec3cab9ed Mon Sep 17 00:00:00 2001 From: vermont Date: Wed, 14 Feb 2024 06:16:41 -0500 Subject: [PATCH] Support old "lastread" name as property, for existing libraries that use it. --- moviepy/video/io/ffmpeg_reader.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/moviepy/video/io/ffmpeg_reader.py b/moviepy/video/io/ffmpeg_reader.py index 0fe657d91..a40af762e 100644 --- a/moviepy/video/io/ffmpeg_reader.py +++ b/moviepy/video/io/ffmpeg_reader.py @@ -249,6 +249,13 @@ def get_frame_number(self, t): # are getting the nth frame by writing get_frame(n/fps). return int(self.fps * t + 0.00001) + @property + def lastread(self): + """Support old name of the "last_read" attribute, which may be used + by existing libraries, such as scenedetect. + """ + return self.last_read + def close(self, delete_last_read=True): """Closes the reader terminating the process, if is still open.""" if self.proc: