在sql Server中以二进制格式存储视频 [英] Storing Video In Binary Format in sql Server

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

问题描述

在sql server中以二进制格式存储视频是好的吗?



i将此用于图像和mp3都工作正常。



但是当使用Video然后我能够存储视频但我无法播放

It is Good to Store Video in Binary Format in sql server?

i used this for image and mp3 both working fine.

But when using Video then i''m able to store video but i''m unable to play

推荐答案

你可以在SQL服务器中存储视频,但我强烈反对它。

有几个原因:



1)数据库的总大小是有限的(多少取决于您使用的SQL服务器的版本),视频通常非常大:每小时运行大约500MB,或者更多用于hi res它不需要很多视频来填充数据库容量。

2)当你在SQL中存储视频时,你必须从SQL中检索它 - 这意味着它使用SQL Server实例带宽以惊人的速度 - 它可以严重减慢其他用户(和你的代码,因为SQL没有任何流数据的概念,并将其作为一个返回单片对象)



由于这些原因,我会将视频存储在一个文件中,并将该文件的地址存储在SQL中。 (对于图像大于缩略图大小的图像,我也建议这样做,比如100x100像素)
You can store video in SQL server, but I would strongly advise against it.
There are a couple of reasons for this:

1) The total size of a database is limited (how much so depends on the version of SQL server you are using) and video is generally pretty big: running around 500MB per hour, or more for hi res it doesn''t take many videos to fill a DB to capacity.
2) When you store video in SQL you have to retrieve it from SQL - and that means that it uses the SQL Server Instance bandwidth at a phenomenal rate - it can seriously slow down other users (and your code, since SQL doesn''t have any concept of "streaming" data and returns it as a monolithic object)

For these reasons, I would store the video in a file, and store the address of that file in SQL. (I also recommend this for images where the image is bigger than thumbnail size, say 100x100 pixels)


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

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