Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. from video_processing import VideoChunkReader
  2. from moviepy.editor import *
  3. import time
  4. import cv2
  5.  
  6. true_path = "true/"
  7. false_path = "false/"
  8.  
  9. for video_name in ["Argentina x Egypt Mens Handball World 2017 FULL MATCH"]:
  10.  
  11. video_reader = VideoChunkReader(video_name + ".mp4")
  12. count = 57
  13.  
  14. shot_length = 0
  15. while(video_reader.has_next()):
  16. chunk = video_reader.get_next()
  17.  
  18. type = -1
  19. count += 1
  20.  
  21. print("clip count: ", count)
  22.  
  23. if(chunk.get_frames_count() >= 2):
  24. chunk.get_clip().preview()
  25. else:
  26. type = 0
  27.  
  28. while(type < 0 or type > 1):
  29. try:
  30. type = int(input("Enter a type of clip: "))
  31. except:
  32. type = -1
  33.  
  34. # print(type(type))
  35. if(type < 0 or type > 1):
  36. print("y3l2 d5l integer from 0 to 1 :D")
  37.  
  38. if(type == 1):
  39. chunk.get_audio().write_audiofile(true_path + str(count) + '.mp3')
  40. elif(type == 0):
  41. chunk.get_audio().write_audiofile(false_path + str(count) + '.mp3')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement