Open sunpyuser opened 5 months ago
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.
Hello, Thank you for sharing the open source project,when I tried to calculate video duration using VideoFileClip, I found the following code online
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
My source code
I tried to solve this problem and succeeded.
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