如何创建视频缩略图或预览?
我想显示网站上列出的视频的缩略图或预览面板,我想从视频中获取单个帧(从特定时间即获取 1 分钟后的帧)并将它们显示为缩略图,就像在 YouTube 中一样。 ?
有什么帮助吗
i want to display thumbnails or preview panels for videos listed on my site, i want to fetch a single frame from a video (from a particular time i.e get a frame of exactly after 1 min) and display them as thumbnails as in youtube...
Any help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看一下 ffmpeg-php 库。这是在 PHP 中操作不同格式视频的唯一简单方法。
还有一个名为 PHP Video Toolkit 的包装器,您可以在这里找到它:http:// sourceforge.net/projects/phpvideotoolkit/
Take a look at the ffmpeg-php library. It's the only simple way to manipulate videos of different formats in PHP.
There's also a wrapper called PHP Video Toolkit, you can find it here: http://sourceforge.net/projects/phpvideotoolkit/
添加如何使用 ffmpeg 答案,这是您要查找的参数:
Adding to how to use the ffmpeg answer, this is the parameters you're looking for:
在现代浏览器中,您还可以使用视频标签和画布来捕获帧并将其保存为图像。
请参阅我们如何获得使用canvas的html5视频截图
In modern browsers you can also use the video tag and canvas to capture a frame and save it as an image.
see How can we get the screenshot of the video in html5 using canvas