赞
踩
pip install -i https://mirrors.aliyun.com/pypi/simple moviepy
from moviepy.editor import VideoFileClip video_path = r"E:\My_Data\视频素材\H-264\V00099E.mp4" # 加载视频文件 clip = VideoFileClip(video_path) # 获取视频总时长(以秒为单位) total_duration = clip.duration # 打印总时长 print("视频总时长:{} 秒".format(total_duration)) # 关闭视频文件 clip.close()
运行效果如下:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。