如何在 PHP 中获取 .flv 第一帧的快照?
并将其另存为图像。
PHP 可以完成这样的工作吗?
And save it as an image.
Is this kind of job possible in PHP?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
并将其另存为图像。
PHP 可以完成这样的工作吗?
And save it as an image.
Is this kind of job possible in PHP?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
PHP 有一个
ffmpeg
库,您可以使用它来实现此目的。利用ffmpeg_movie
您可以将视频文件作为对象返回:$movie = new ffmpeg_movie('/path/to/.flv');
然后您可以继续使用
getFrame()
方法,该方法将帧作为ffmpeg_frame
对象返回,该对象的方法toGDImage()
返回一个GD
框架的图像。显然需要启用GD
库。PHP has an
ffmpeg
library which you can use for this. Utilizingffmpeg_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 anffmpeg_frame
object, which has the methodtoGDImage()
which returns aGD
image of the frame. Obviously theGD
library needs to be enabled.请参阅此问题。
所有解决方案似乎都依赖于 FFMPEG(因此这不太可能适用于共享网络托管)。
See this question.
All the solutions seem to rely on FFMPEG (so it's unlikely this would work on shared web hosting, for example).