对大量视频文件按时间间隔进行自动化截图

265 views
Skip to first unread message

Xing Lin

unread,
Oct 27, 2013, 11:16:19 PM10/27/13
to ustc...@googlegroups.com

有什么高效的方法?求助。

Bojie Li

unread,
Oct 27, 2013, 11:32:46 PM10/27/13
to USTC_LUG

ffmpeg -i video_file -f image2 -vf fps=fps=1/interval snapshot%04d.png

这里 interval 是截图间隔,单位秒。如果不需要全部截图,还可以用 -ss 参数指定开始时间,-t 指定时长或 -vframes 指定截图帧数。

输出文件就是 snapshot0001.png,snapshot0002.png......

如果是多个视频文件,写个脚本分别处理就行了,注意截图结果保存在不同的目录里。

2013-10-28 上午11:16于 "Xing Lin" <olinl...@gmail.com>写道:

有什么高效的方法?求助。

--
-- 来自USTC LUG
请使用gmail订阅,不要灌水。
更多信息more info:http://groups.google.com/group/ustc_lug?hl=en?hl=en
 
---
You received this message because you are subscribed to the Google Groups "USTC_LUG" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ustc_lug+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Xing Lin

unread,
Oct 27, 2013, 11:40:26 PM10/27/13
to ustc...@googlegroups.com

怎么防止出现某一张图片是全黑的?

Bojie Li

unread,
Oct 27, 2013, 11:42:04 PM10/27/13
to USTC_LUG

视频里这一帧本来就是全黑的吗?

Xing Lin

unread,
Oct 27, 2013, 11:45:54 PM10/27/13
to ustc...@googlegroups.com

摄像头一直开着拍摄一个物体,应该不会出现黑帧吧?

Bojie Li

unread,
Oct 27, 2013, 11:47:51 PM10/27/13
to USTC_LUG

我不知道,先试试吧。

Reply all
Reply to author
Forward
0 new messages