如何从数据库中检索视频? [英] How to retrieve video from database?

查看:80
本文介绍了如何从数据库中检索视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想存储&从SQL数据库中检索视频。在C#编码的帮助下,该视频必须在vlc或Windows媒体播放器中播放。告诉我解决方案....



我尝试过的:



我尝试使用流量播放器......

I want to store & retrieve video from SQL database. That video has to be play in vlc or windows media player with the help of C# coding.Tell me the solution....

What I have tried:

I tried with flow player......

推荐答案

认真地?不要这样做。

问题是视频文件很大 - 并且变得非常大,非常快。当您编写代码以从数据库中检索它们并将它们流式传输到VLC或媒体播放器时,您将内存,带宽和其他所有内容都加倍。想一想:SQL Server必须将数据检索到它的内存中。然后将其提供给网络以传递给您的应用程序。它分配内存来存储它,并将其传递给第三方应用程序,如VLC或一个(单独的机器,如果这是一个ASP.NET应用程序,将是客户端PC)

这是一个巨大的被抛出的数据量,并且使用疯狂的资源 - 这意味着延迟,缓冲和一般的肮脏。



更好的解决方案是存储到数据库中的视频文件,并用它来访问实际的视频数据。幸运的话,你可以将路径传递给你的电影播放器​​并直接访问数据或流。
Seriously? Don't do it.
The problem is that video files are big - and get very big, very quickly. When you write code to retrieve them from a DB and stream them to VLC or Media player, you are doubling the memory, the bandwidth, and everything else involved. Think about it: SQL Server has to retrieve the data into it's memory. It then feeds that to the network to pass to your application. Which allocates memory to store it, and passes it either to a third party app like VLC or to a (separate machine if this is an ASP.NET app that would be the client PC)
That's a huge amount of data being thrown around, and that uses resources like crazy - which means delays, buffering, and general nastiness.

A better solution is to store a path to the video file in the DB, and use that to access the actual video data. With luck, you can just pass the path to your movie player and it accesses the data or stream directly.


看一下这个链接希望这会有所帮助:使用C#和VB.Net上传保存检索并播放来自ASP.Net中数据库的实时流媒体的MP4视频文件 [ ^ ]
Take a look at this link hope this will help: Upload Save Retrieve and Play MP4 Video files with live streaming from Database in ASP.Net using C# and VB.Net[^]


在sql server中检查BLOB的文件流概念。
Check filestream concept in sql server for BLOB.


这篇关于如何从数据库中检索视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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