在sql中存储视频 [英] storing video in sql

查看:71
本文介绍了在sql中存储视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用c#asp.net进行编码.我正在准备一个用于从sql数据库访问多媒体(视频,音频等)文件的网页.所以,我该怎么做?

i am codding in c# asp.net . i am preparing a web page for accessing multimedia (video , audio,......)files from sql database. so how can i do this please?

推荐答案

参考:

您可以按照以下方法进行操作:使用ASP.NET上传文件 [文件流 [ ^ ].它是数据库和文件系统的组合,因此您具有两者的优势.本教程有其缺陷,但它是一个很好的起点: How Do I:使用SQL文件流 [ ^ ]),我还将阅读这两个内容: http: //msdn.microsoft.com/zh-CN/magazine/dd695918.aspx [
You can follow this approach: File Upload with ASP.NET[^], but as videos tend to be large files, I suggest not using the database itself. SQL Server is providing a really usefull architecture, called filestream[^]. It is a combination of the database and the file system, thus you have the advantages of both. This tutorial has it flaws, but it is a good starting point: How Do I: Use SQL File Stream[^], and I would also read this one two: http://msdn.microsoft.com/en-us/magazine/dd695918.aspx[^].


我不建议您将视频/音频存储在sql服务器中,它不是用于流式传输视频/音频的,您必须将其从sql server中检索到临时文件夹,然后使用IIS平滑流或其他方法进行流处理.因此浪费资源.

我建议您仅将元数据以及音频/视频文件的路径存储在数据库中,并将文件存储在硬盘驱动器上.这样您就可以从数据库中搜索视频信息,然后使用该路径从硬盘驱动器中获取视频/音频.

如果图像很多,我什至不会投票赞成将图像存储在数据库中.

但是,如果您没有其他选择,那就继续尝试其他人提供的解决方案.
I dont suggest you to store video/audio in sql server, it is not built for streaming video/audio, you will have to retrieve it from sql server to a temp folder and then stream it using IIS smooth streaming or something. so it is waste of resources.

I will suggest you to store only meta-data along with the path of the audio/video file in database, and store the files on hard drive. so that you can search the video information from database and then use the path to get the video/audio from hard drive.

I will even do not vote for storing images in database, if they are many.

But if you do not have any option then go ahead with the solutions provided by others.


这篇关于在sql中存储视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆