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

Video processing hangs indefinitely with corrupted video segments #2283

Open
Archkik opened this issue Dec 6, 2024 · 2 comments
Open

Video processing hangs indefinitely with corrupted video segments #2283

Archkik opened this issue Dec 6, 2024 · 2 comments
Labels
bug Issues that report (apparent) bugs. v2.x Issues based on MoviePy version 2.0 and upwards

Comments

@Archkik
Copy link

Archkik commented Dec 6, 2024

When processing a video containing corrupted segments, the subclipped function (and other methods depending on get_frame) can hang indefinitely without raising an error or timeout. This behavior seems to be caused by the underlying frame_function implementation, which does not handle corrupted frames or set a timeout for frame decoding.

video_path = "path_to_corrupted_video.mp4"  
video = VideoFileClip(video_path)
try:
    sub_clip = video.subclipped(43, 50)
except Exception as e:
    print(f"Error: {e}")

Expected Behavior

Raise an error indicating that the frame cannot be decoded, or
Raise a Timeout error

Actual Behavior

The function hangs indefinitely without raising an error, likely due to the underlying frame decoding stalling when encountering corrupted frames.

Specifications

  • Python Version: 3.11
  • MoviePy Version: 2.1.1
  • Platform Version: Windows10
@Archkik Archkik added the bug Issues that report (apparent) bugs. label Dec 6, 2024
@Archkik Archkik closed this as completed Dec 6, 2024
@Archkik Archkik reopened this Dec 6, 2024
@Archkik
Copy link
Author

Archkik commented Dec 6, 2024

from moviepy import VideoFileClip
video_path = "output_video1.mp4"  
video = VideoFileClip(video_path)
try:
    sub_clip = video.subclipped(6, 8)
    print("OK")
except Exception as e:
    print(f"Error: {e}")

output_video1.zip

@keikoro keikoro added the v2.x Issues based on MoviePy version 2.0 and upwards label Dec 8, 2024
@OsaAjani
Copy link
Collaborator

I cannot reproduce under Linux with version 2.1.2, can you check on your end and verify if the issue still exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that report (apparent) bugs. v2.x Issues based on MoviePy version 2.0 and upwards
Projects
None yet
Development

No branches or pull requests

3 participants