You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into a problem, I process a large number of videos, but on some videos the script just gets up and does nothing. I wondered why this is so?
As a result, the problem is in the line(everything is running before it):
s = self.proc.stdout.read(L) in read_chunk() readers.py . It just doesn't output anything.
The bottom line is that videos that have sound, process everything correctly, then I started testing videos that don't have sound, for some reason self.reader.infos['audio_found'] == True. Because of this, audio editing is being launched. Then everything is fine, the result is self.proc =={'bufsize': 200000, 'stdout': -1, 'stderr': -1, 'stdin': -3, 'creationflags': 134217728}, the same as in a normal video. self.proc.stdout == <_io.BufferedReader name=6> as in a normal video, but when another read() element is added, the script just freezes.
I couldn't come up with a solution. So I'm informing you about it.
I understand that this is most likely a problem with the file itself. Since the properties of the video file display the audio stream rate and so on. Although in fact there is no sound.
But, I need some more checking, waiting, I don't know. If, for example, there is no response within 3 minutes, the script throws an error.
The text was updated successfully, but these errors were encountered:
Fixed the problem via timeout. Checking the validity of the file via VideoFileClip. If no response has been received within 10 seconds, it ends.
import multiprocessing
import time
from moviepy.editor import VideoFileClip, CompositeVideoClip
import sys
def process_video_clip(video):
dir_movies = r"D:\AutoMaterial Random\videos"
with VideoFileClip(dir_movies + "\\" + video) as main_clip:
sum = 1
if __name__ == '__main__':
video = sys.argv[1]
p = multiprocessing.Process(target=process_video_clip, args=(video,))
multiprocessing.freeze_support()
p.start()
# We wait 10 seconds or until the process is completed
p.join(10)
if p.is_alive():
print("Stop process")
p.terminate()
p.join()
with open("file.txt", "w") as file:
file.write("False")
print("write False")
else:
with open("file.txt", "w") as file:
file.write("True")
print("write True")
I ran into a problem, I process a large number of videos, but on some videos the script just gets up and does nothing. I wondered why this is so?
As a result, the problem is in the line(everything is running before it):
s = self.proc.stdout.read(L) in read_chunk() readers.py . It just doesn't output anything.
The bottom line is that videos that have sound, process everything correctly, then I started testing videos that don't have sound, for some reason self.reader.infos['audio_found'] == True. Because of this, audio editing is being launched. Then everything is fine, the result is self.proc =={'bufsize': 200000, 'stdout': -1, 'stderr': -1, 'stdin': -3, 'creationflags': 134217728}, the same as in a normal video. self.proc.stdout == <_io.BufferedReader name=6> as in a normal video, but when another read() element is added, the script just freezes.
I couldn't come up with a solution. So I'm informing you about it.
I understand that this is most likely a problem with the file itself. Since the properties of the video file display the audio stream rate and so on. Although in fact there is no sound.
But, I need some more checking, waiting, I don't know. If, for example, there is no response within 3 minutes, the script throws an error.
The text was updated successfully, but these errors were encountered: