如何使用python查看视频的长度,python查看长度,import sub
如何使用python查看视频的长度,python查看长度,import sub
import subprocessimport redef get_length(filename): result = subprocess.Popen(["ffprobe", filename], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) for x in result.stdout.readlines(): if b"Duration" in x: print(x) x = re.search(rb"Duration.+?\d{2}:(\d{2}):\d{2}", x) return int(x.group(1))print(get_length(r"C:\Users\Administrator\Desktop\1.mp4"))‘‘‘b‘ Duration: 00:17:25.00, start: 0.000000, bitrate: 507 kb/s\r\n‘17‘‘‘
如何使用python查看视频的长度
相关内容
- Python爬取中国天气网天气,python爬中国天气,Python爬取中
- 【selenium+Python unittest】之发送邮箱时报错:smtplib.SMT
- python中的encode()和decode()函数,encodedecode,前言:我
- OpenCV3计算机视觉+Python(五),opencv3python,人脸检测和识别
- 利用Python爬取豆瓣电影,python爬豆瓣电影,目标:使用P
- python strip() 函数,pythonstrip函数,strip()用于把
- python-day7--%s与%d的使用,python2中的input及raw_input,,#co
- 深度学习之前期准备工作--python,pip,numpy,tensorflow安装,
- 完美配置Python3.5+Anaconda+PyQt5,实现UI和其他模块的结合
- 96、python version 3.6 required,which was not fount in the registry(
评论关闭