Я пытаюсь создать загрузчик видео в приложении kivy, используя OpenCV. Однако, когда я пытаюсь загрузить видео, я получаю следующую ошибку
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000021c356d9e00] moov atom not found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000021c356d9e00] moov atom not found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000021c356d9e00] moov atom not found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000021c356d9e00] moov atom not found
...
При этом экран перестает отвечать на запросы. Недавно я отредактировал функцию save () и добавил uploadClass (), потому что я получаю еще одну ошибку.
main.py
...
class SaveDialog(Screen):
save = ObjectProperty(None)
text_input = ObjectProperty(None)
cancel = ObjectProperty(None)
def save(self, path, filename):
for letter in os.path.join(path, filename):
print(letter)
def find(s, ch):
return [i for i, letter in enumerate(s) if letter == ch]
os_path_simpl = list(os.path.join(path, filename))
for t in range(len(find(os.path.join(path, filename), '\\'))):
os_path_simpl[find(os.path.join(path, filename), '\\')[t]] = '\\'
class uploadClass(object):
video = ''.join(os_path_simpl)
def __init__(self, src=video):
self.video_selected = cv2.VideoCapture(src)
self.vid_cod = cv2.VideoWriter_fourcc(*'mp4v')
self.out = cv2.VideoWriter('media/testOne.mp4', self.vid_cod, 20.0, (640,480))
self.thread = Thread(target=self.update, args=())
self.thread.daemon = True
self.thread.start()
def update(self):
while True:
if self.video_selected.isOpened():
(self.status, self.frame) = self.video_selected.read()
def show_frame(self):
if self.status:
cv2.imshow('uploading', self.frame)
if cv2.waitKey(10) & 0xFF == ord('q'):
self.video_selected.release()
self.out.release()
cv2.destroyAllWindows()
exit(1)
def save_frame(self):
self.out.write(self.frame)
rtsp_stream_link = 'media/testOne.mp4'
upload_Class = uploadClass(rtsp_stream_link)
while True:
try:
upload_Class.__init__()
upload_Class.show_frame()
upload_Class.save_frame()
except AttributeError:
pass
sm.current = "home"
...