获取 divx/avi 和 mkv 视频的缩略图 (ASP.net)
当用户上传视频(仅允许 divx/avi/mkv)时,我想获取视频的缩略图,以便在单击播放之前可以在 divx 播放器中显示该缩略图。有什么办法可以做到这一点是 ASP.net 或 javascript。
When the user uploads a video (only divx/avi/mkv allowed) I'd like to get a thumbnail for the video so that is can be displayed in the divx player before play is clicked. Is there any way to do this is ASP.net or javascript.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 ffmpeg 创建缩略图。
查看此博文:链接
在 .net 中,您可以创建进程并传递参数以从代码中执行该工具。
You can use ffmpeg to create your thumbnails.
Checkout this blog post : link
In .net you can create Process and pass arguments to execute the tool from your code.
最简单的方法是使用 FFMpeg 之类的东西,尽管它是一个命令行应用程序,而且你' d 可能需要围绕它编写某种包装器。有关您可能需要使用的确切参数的更多信息,请查看 使用 ffmpeg 创建视频缩略图。
还有一些其他选项,例如 Flash Video MX SDK,但它们倾向于是 COM 解决方案而不是托管代码,并且通常实现起来相当笨拙。它们也可能非常昂贵,这可能使它们不可行。
The easiest way to do this would be to use something like FFMpeg, though it's a command line application and you'd probably need to write some kind of wrapper around it. For more information on the exact parameters you might need to use, check out Creating video thumbnails using ffmpeg.
There are some other options, such as Flash Video MX SDK, but they tend to be COM solutions rather than managed code and are generally quite clunky to implement. They can also be quite expensive, which may make them unfeasible.