Create thumbnail from video using ffmpeg

半城伤御伤魂 提交于 2020-07-31 08:01:48

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/27145238/create-thumbnail-from-video-using-ffmpeg

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!