Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#2074
Why did I make these changes?
I was building an application that allows a user to edit a video and get a video as output and end the video creation process whenever needed with a button.
But Moviepy couldn't stop the video creation process, so I decided to apply these changes.
I added a function called "stop_processing_video" in utils. This function takes a "filename" argument, and this is the name you can pass to the "write_videofile" function. This function stops the video creation process and deletes temporary files.
how it works
I added a list in the module "ffmpeg_writer.py" named "VIDEOS_TO_STOP". If the name of the video being processed is included in this list, the processing of that video will be stopped by the function "ffmpeg_write_video". In the "ffmpeg_write_video" function, the following condition is placed, which stops the video processing.
I did the same in the "ffmpeg_audiowriter.py" modules.
Example
In this example, I start processing 3 videos simultaneously and then stop processing video 1 and video 3 using the stop_processing_video function.
tests/