2024-05-19 05:51:47 发布
网友
我将此片段用作视频源,稍后再处理:
import vapoursynth as vs core = vs.core core.std.LoadPlugin("/usr/local/lib/libffms2.so") video = core.ffms2.Source("videotest.mkv")
如何获取指定帧的时间戳或获取每个帧的时间戳列表?你知道吗
根据FFMS2和The VapourSynth API-Reference的文档,可以通过访问每个帧的_AbsoluteTime属性来获得帧的时间戳。你知道吗
_AbsoluteTime
使用video.frames()在每个帧上获取迭代器:
video.frames()
for frame in video.frames(): print(frame.props["_AbsoluteTime"])
下面是另一个例子:
>>> import vapoursynth >>> s = vapoursynth.core.ffms2.Source(r"Z:\Anime\Serien\Incomplete\Akanesasu Shoujo\[HorribleSubs] Akanesasu Shoujo - 01 [1080p].mkv") >>> f = s.get_frame(0) >>> f.props <vapoursynth.VideoProps {'_AbsoluteTime': 0.043, '_ChromaLocation': 0, '_ColorRange': 1, '_DurationDen': 1000, '_DurationNum': 41, '_FieldBased': 0, '_Matrix': 2, '_PictType': b'I', '_Primaries': 2, '_SARDen': 1, '_SARNum': 1, '_Transfer': 2}> >>> f.props._AbsoluteTime 0.043
根据FFMS2和The VapourSynth API-Reference的文档,可以通过访问每个帧的
_AbsoluteTime
属性来获得帧的时间戳。你知道吗使用
video.frames()
在每个帧上获取迭代器:下面是另一个例子:
相关问题 更多 >
编程相关推荐