使用ffmpeg从视频创建缩略图 [英] Create thumbnail from video using ffmpeg
问题描述
在将视频上传到CDN时,我需要从视频创建缩略图.
我一直在搜索找到的播放视频 >
在使用ffmpeg上传视频时,有人可以帮助我创建缩略图
我不知道在上传时制作屏幕截图的方法,但是我确实知道以后如何做.
最简单的代码是:
ffmpeg -i input.mp4 -ss 00:00:01.000 -vframes 1 output.png
上传文件后运行此脚本.如果截屏是在视频开始处拍摄的,则只需要很短的时间. (例如第一分钟).
我认为在仍在上传文件的同时无法截屏.
删除了-f image2
,因为ffmpeg认为它是正确的
I need to create a thumbnail from video while uploading it to CDN.
I have been searching for this found this but I am not able to get the screen shot even after following steps.
I am using jwplayer for playing video
Can someone help me to create thumbnail while uploading video using ffmpeg
I do not know a way to make a screenshot WHILE uploading, but I do know how to do it after.
The simplest code is:
ffmpeg -i input.mp4 -ss 00:00:01.000 -vframes 1 output.png
Run this script after you have uploaded the file. It should take only a short amount of time if the screenshot is taken in the beginning of the video. (first minute e.g.).
I do not think it is possible to take a screenshot while the file is still being uploaded.
Edit:
removed -f image2
as it is guessed correct by ffmpeg
这篇关于使用ffmpeg从视频创建缩略图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!