moviepy icon indicating copy to clipboard operation
moviepy copied to clipboard

An error occurred in calculating the duration of multiple videos in one folder using VideoFileClip

Open sunpyuser opened this issue 2 years ago • 1 comments

Hello, Thank you for sharing the open source project,when I tried to calculate video duration using VideoFileClip, I found the following code online 1705762950921 The method successfully calculated the duration of a single video, but encountered an error when attempting to calculate the duration of each video in the same folder. like this 1705763191195 My source code 1705763748230 1705763764612 I tried to solve this problem and succeeded. 1705763559245 I think the problem is that VideoFileClip uses a file handle internally to read the video file contents. So after reading the video, i need to close this file handle to free up resources. But why isn't it necessary to close files when processing a single video, Operating system: windows Python version: 3.10 Project version/Commit hash: Latest

sunpyuser avatar Jan 20 '24 15:01 sunpyuser

Please always include code samples in the form of code-formatted text, not screenshots. Images of code are very bad practice, see e.g. other platforms like StackOverflow and similar, where this is equally discouraged.

keikoro avatar Feb 10 '24 19:02 keikoro