我一直在尝试从视频文件中提取帧,在尝试使用自己的文件之前,我一直在使用以下代码作为测试。我收到一个与无效文字有关的错误:
import os, sys
from PIL import Image
a, b, c = os.popen3("ffmpeg -i test.avi")`
out = c.read()
dp = out.index(" ")
duration = out[dp+10:dp+out[dp:].index(",")]
hh, mm, ss = map(float, duration.split(":"))
错误:
Traceback (most recent call last):
File "<pyshell#22>", line 1, in -toplevel-
hh, mm, ss = map(float, duration.split(":"))
ValueError: invalid literal for float(): cognized as an internal or external command
如何解决此错误?