qcode
  • 创作工场专业版,一问多答!更智能、更完整、更原创
  • 这是一个超强内容创作平台,它会写文章、做设计、绘图、敲代码,有问必答!
🔥点击使用-免登录深度版🔥

用Python写一段视频切割代码

时间2023-04-27 06:55:40 提问来自 甘肃省兰州市 的网友 分类创作 浏览394
以下是一段使用Python进行视频切割的代码: import cv2 # Opens the Video file cap= cv2.VideoCapture('input_video.mp4') # Used as counter variable count = 0; while(cap.isOpened()): # Capture frame-by-frame ret, frame = cap.read() if ret == True: # Saves the frames with frame-count name = './frames/frame' + str(count) + '.jpg' print ('Creating...' + name) # Write the results back to output location. cv2.imwrite(name, frame) count += 1; else: break # If there are no more frames left cap.release() cv2.destroyAllWindows()

不满意?免费深度重写!

免责声明:
以上内容除特别注明外均来源于网友提问,创作工场回答,未经许可,严谨转载。

上一篇 风水学是怎么个科学原理 下一篇 建设教育强国的青年力 量