如何从数据库中检索视频?

编程入门 行业动态 更新时间:2024-10-28 08:19:13
本文介绍了如何从数据库中检索视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想存储&从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.

更多推荐

如何从数据库中检索视频?

本文发布于:2023-10-28 05:40:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1535692.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据库中   视频

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!