7

使用ffmpeg进行视频图片提取

 2 years ago
source link: https://www.cnblogs.com/MikeZhang/p/ffmpegToImages-20211013.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

使用ffmpeg进行视频图片提取

环境:windows10-x64

ffmpeg的功能很强大,可以进行音频和视频的处理,这里记录下需要从视频文件提取图片的情况。

ffmpeg官方地址:https://www.ffmpeg.org/
使用ffmpeg实现,操作命令如下:
ffmpeg -i [输入文件名] [参数选项] -f [格式] [输出文件]

提取图片参数选项:
-i: 设定输入流
-ss: 指定开始时间(0:0:05)
-t: 指定持续时间(0:0:05)
-r: 提取图像频率(用于视频截图)
–f: 输出格式(视频转码)

使用示例:
ffmpeg -i 1.mp4 ./test/0_%05d.jpg
ffmpeg -i 1.mp4 -ss 0:0:29 -t 0:0:8 -r 16 -f image2 ./test/0_%05d.jpg

命令行虽然很方便,但并不是所有人都喜欢使用,之前封装了一个简单的界面,原理就是调用cmd命令实现,这里分享出来,使用截图如下:

相关资源
ffmpeg.exe ffmpeg主程序
vedioToImags.exe 图片提取操作界面
1.mp4 测试视频

 本文涉及资源下载地址:

https://pan.baidu.com/s/1Mb_Sjl1kWZ8Nb-38kiyhrg

可关注微信公众号(聊聊博文)后回复 2021101301 获得提取码。  


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK