使用 php/js/as3 对 flv 视频进行快照

发布于 2024-12-13 02:33:46 字数 470 浏览 4 评论 0原文

我正在开发一个托管在共享 Linux 服务器上的 php 网站。 我需要允许我的网站的用户使用 flowplayer 上传和播放 flv 视频。 在视频开始之前显示视频快照会很棒,如下所示: http://flowplayer.org/demos/plugins/streaming/first-frame.html

我的服务器不支持伪流,并且没有 ffmpeg/mplayer 支持(毕竟它是共享主机......)

我我猜我该怎么做仅包含 php 或 javascript 或动作脚本的视频第 n 帧的快照。 我读过一些关于 flash >= 8 中的 bitmapdata 类的内容,但我不知道如何在没有用户输入的情况下自动完成所有工作。

有人可以帮助我吗?

谢谢。

I am developing a website in php hosted on a shared linux server.
I need to allow the users of my site to upload and play flv videos with flowplayer.
It would be fantastic to show a snapshot of the video before it starts, something like these: http://flowplayer.org/demos/plugins/streaming/first-frame.html

My server doesn't support pseudostreaming and it has no ffmpeg/mplayer support (it's a shared host after all...)

I am guessing how can I take a snapshot of the nth frame of the video with only php or javascript or action script.
I read something about bitmapdata class in flash >= 8, but i don't know how to do all the work automatically without the user's input.

Can someone help me?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

多孤肩上扛 2024-12-20 02:33:46

AFAIK - 如果您的服务器没有 ffmpeg,您将无法使用 PHP 来完成此操作。

用JS肯定做不到。

这就剩下 AS - 您可以从任何显示对象创建位图,并使用 PHP 将其保存为图像文件,这两者都非常简单 - 但是您不是将能够运行视频以找到第一帧...使用 AS,图像“快照”是显示对象的确切当前可见状态。

如果这足够了 - 获取显示对象的当前状态并将其保存为图像文件 - 回发,我将链接一个示例。

AFAIK - if your server doesn't have ffmpeg, you're not going to be able to do it with PHP.

You definitely can't do it with JS.

Which leaves AS - you can create a bitmap from any display object, and save that as an image file with PHP, both of which are pretty straightforward - but you're not going to be able to run through the video to find the first frame... with AS, the image "snapshot" is the exact current visible state of the display object.

if that is enough - taking the current state of a display object and saving it as an image file - post back and i'll link a sample.

执着的年纪 2024-12-20 02:33:46

如果您使用的是共享 Linux 服务器,则可能安装了 ImageMagick。反过来可能能够从电影中提取特定帧的屏幕截图。然而,这可能只适用于 AVI 文件 - MPEG 电影需要 ffmpeg,并且我不确定 FLV 文件(它们不在 IM 网站上支持的格式列表中)。

可以换成VPS吗?这将为您提供安装所需转换二进制文件所需的 root 访问权限。如今,一个具有 256M-512M RAM 的合理盒子将花费您 5 美元 pcm,具体取决于质量和支持(我为一个 512M 盒子支付 4GBP pcm,它确实坚如磐石)。

If you're on a shared Linux server, you might have ImageMagick installed. That in turn may be able to extract a screenshot of a particular frame from a movie. However this will probably only work on AVI files - MPEG movies require ffmpeg, and I am not sure about FLV files (they're not in the list of supported formats on the IM website).

Could you switch to a VPS? This will give you the root access you need to install the conversion binaries you need. These days a reasonable one with 256M-512M of RAM will cost you from 5USD pcm depending on the quality and support (I pay 4GBP pcm for a 512M box and it really has been rock solid).

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