如何创建视频缩略图或预览?

发布于 2024-08-21 18:22:37 字数 102 浏览 4 评论 0原文

我想显示网站上列出的视频的缩略图或预览面板,我想从视频中获取单个帧(从特定时间即获取 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

深海里的那抹蓝 2024-08-28 18:22:37

看一下 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/

注定孤独终老 2024-08-28 18:22:37

添加如何使用 ffmpeg 答案,这是您要查找的参数

ffmpeg  -itsoffset -4  -i test.avi -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 test.jpg

Adding to how to use the ffmpeg answer, this is the parameters you're looking for:

ffmpeg  -itsoffset -4  -i test.avi -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 test.jpg
叹梦 2024-08-28 18:22:37

在现代浏览器中,您还可以使用视频标签和画布来捕获帧并将其保存为图像。

请参阅我们如何获得使用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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文