PHP function/library to create screenshot from mov

2019-05-13 00:16发布

I have a site where users upload movies (MP4, FLV, OGV).

I need a PHP function to generate a poster/screenshot in JPG automatically from an uploaded movie. The screenshot should be for the opening scene of the movie.

If it is a javascript utility (rather than PHP), that will be fine too.

I can't find anything. Where should I look?

2条回答
Viruses.
2楼-- · 2019-05-13 00:47

You could easily do that with ffmpeg-php. You will need to have FFMPEG installed on the server for this.

查看更多
Ridiculous、
3楼-- · 2019-05-13 01:00

Take a look at FFmpeg. It's a very capable video manipulation tool that can be run from PHP with exec(). For example, to extract the first frame from a video file, you could use:

ffmpeg -i video.flv -ss 0 -vframes 1 shot.png
查看更多
登录 后发表回答