How to get a snapshot of the first frame of a .flv in PHP?

强颜欢笑 提交于 2019-12-25 04:40:19

问题


And save it as an image.

Is this kind of job possible in PHP?


回答1:


PHP has an ffmpeg library which you can use for this. Utilizing ffmpeg_movie you can return a video file as an object:

$movie = new ffmpeg_movie('/path/to/.flv');

You can then go on and use the getFrame() method, which returns the frame as an ffmpeg_frame object, which has the method toGDImage() which returns a GD image of the frame. Obviously the GD library needs to be enabled.




回答2:


See this question.

All the solutions seem to rely on FFMPEG (so it's unlikely this would work on shared web hosting, for example).



来源:https://stackoverflow.com/questions/4415069/how-to-get-a-snapshot-of-the-first-frame-of-a-flv-in-php

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