远程视频和缩略图 - 全部经过研究
大家好,
我一直在努力为我的网站获取缩略图,并取得了一些相当不错的进展。正如我所希望的那样,我已经能够在本地创建图像的缩略图以及托管在远程服务器上的图像的缩略图。
我遇到的问题是我无法对视频执行相同的操作。我已经成功安装了以下每个项目及其依赖项,并确认它们都在本地工作:
- ffmpeg (以及替代 ffmpeg-PHP 和 ffmpegthumnailer)
- Imagick (当前适用于所有简单的“图像”缩略图创建,本地和远程)
- mplayer
截至但我一直无法找到一种方法可以让我从远程服务器上自己的视频文件中捕获缩略图。我尝试连接到远程视频文件的原因是因为这些视频每个的大小从 5MB 到 300MB 不等,我不想只是为了创建缩略图而在本地复制整个电影。
我遇到过其中一个“可能”允许从 rtmp 流捕获图像,我可以方便地访问它......但没有取得任何成果。
任何想法将不胜感激,
谢谢你,
Silver Tiger
来自 Silver Tiger 的更新:
看起来我有通过第三方的替代方法。我使用 Zendcoder 将视频文件即时转换为可以在我的 Web 项目上可靠播放的标准格式,作为其服务的一部分,他们将自动创建动态缩略图并将其与转换后的视频一起上传到我的 Amazon S3文件。
危机避免了,但以一种迂回的方式,不幸的是,这不是我可以作为“解决方案”提供给其他任何人的解决方案。
Greetings all,
I have been working to get thumbnail images for a site of mine and have made some fairly decent progress. I have been able to create thumbnails of images locally and those hosted on a remote server as I had hoped.
The issue I am having is that I am unable to do the same for Videos. I have successfully installed each of the following along with their dependencies and confirm they are all working locally:
- ffmpeg (and vicariously ffmpeg-PHP and ffmpegthumnailer)
- Imagick (currently working for all simple "image" thumbnail creation, local and remote)
- mplayer
As of yet I have been unable to find a method that would allow me to capture a thumbnail from my own video files on a remote server. The reason I am trying to connect to a remote video file is because these videos can range from 5MB to 300MB each and I don't desire to copy the entire movie locally just to create a thumbnail.
I had come across one of these that "may" allow capturing an image from a rtmp stream, which I conveniently do have access to ... but nothing fruitful came of it.
Any ideas would be greatly appreciated,
Thank you,
Silver Tiger
Update from Silver Tiger:
Looks like i had an alternative method via a third party. I used Zendcoder to convert the video files on the fly to a standard format that can play on my web project reliably, and as part of thier service, they will automatically create a dynamic thumbnail and upload it to my Amazon S3 along side the converted Video file.
Crisis averted, but in a roundabout way, and not a solution I could provide as a "solution" to anyone else unfortunately.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果你安装了 ffmpeg,那应该很容易。尝试这样的事情
If you have ffmpeg installed it should be quite easy. Try something like this
也许您可以在远程服务器上有一个脚本来调用?这样缩略图就在远程服务器上生成,然后传回前端服务器。
最简单的方法是安装 apache(或您喜欢的任何东西)并在那里托管缩略图生成脚本。
然后你需要做的就是调用:
Maybe you could have a script on the remote server to call? This way the thumbnail is generated on the remote server, and then passed back to the front-end server.
The easiest way to do this is to install apache (or whatever you prefer) and host the thumbnail generation scripts on there.
Then all you would need to do is call: