使用 PHP 将 DVD 转换为 FLV 文件——这可行吗?疯狂的?什么是替代方案?
有些用户告诉我,他们有兴趣直接从 DVD 上传视频到我的网站(当然,他们拥有 DVD 的权利)。
我以前从未遇到过这种情况,但我想这会占用大量资源并且会堵塞服务器,这是我想避免的。
基本的 Google 搜索会返回大量 DVD 到 FLV 转换器 但似乎所有这些似乎都是需要在上传之前用于转换文件的应用程序。
那么,如果这不是一个可怕的想法,我将如何使用 PHP 或任何 Linux 命令行工具来实现它呢?
或者如果这很疯狂,为什么这是一个坏主意?还有哪些其他可能的替代方案?
例如,我可以看到另一种选择:
- 显示有关如何在上传之前将文件转换为有效上传格式的信息
So I have users who have told me they are interested in being able to upload videos to my site straight from DVD's (for which they own the rights, of course).
I've never encountered this before, but I would imagine this would take an enormous amount of resources and would clog up the servers, which I would like to avoid.
A basic google search returns numerous DVD to FLV converters but all seem to appear to be applications which would need to be used to convert the files before uploading.
So, if this isn't a horrible idea, how would I go about implementing it using PHP or any Linux command line tool?
Or if this is insane, Why is this a bad idea? and What are other possible alternatives?
As an example, I could see an alternative being:
- showing information about how to convert the files to a valid upload format before uploading
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
搜索 ffmpeg - 我不知道它是否读取 DVD 文件,但大多数视频格式都可以,请参阅:
http://en.wikipedia.org/wiki/Libavcodec
这是一个命令行程序,可以在多种视频格式之间进行转换。
您无法避免服务器上的巨大负载,因为转换视频只需要大量计算。也许有一种方法可以限制程序占用的资源并减慢速度 - 但这会增加执行时间。在多核服务器上,转换视频时只会加载一个核心,所以也许这不是问题?
请记住,上传大文件(如 DVD 视频)也可能是一个问题,您应该注意带有进度条的漂亮上传器(例如 flash 上传器)
Search for ffmpeg - i don't know does it reads DVD files, but most of video formats can, see:
http://en.wikipedia.org/wiki/Libavcodec
It's a command line program, which can convert between many video formats.
You can't avoid huge load on server, because converting video simply require lot of computations. Maybe there is a way to restrict resources that program takes and slow it down - but it will have cost in execution time. On multi-core server, only one core will be loaded when converting video, so maybe this is not a problem ?
Remeber that uploading large files (like DVD video is) can also be a problem, and you should watch to nice uploader with progress bar (for example flash uploader)