Create thumbnail from video using ffmpeg

后端 未结 1 1069
情话喂你
情话喂你 2021-02-01 07:00

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 followin

1条回答
  •  既然无缘
    2021-02-01 07:32

    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

    0 讨论(0)
提交回复
热议问题