PHP function/library to create screenshot from movie [closed]

帅比萌擦擦* 提交于 2019-12-22 09:26:45

问题


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?


回答1:


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



回答2:


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



来源:https://stackoverflow.com/questions/10801573/php-function-library-to-create-screenshot-from-movie

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