我可以使用Delphi 2010中的TFilterGraph和TVideoWindow从文件系统渲染视频。我想从MemoryStream渲染视频,而不是直接从文件系统渲染。这是概念:
如何告诉FilterGraph使用MemoryStream而不是文件?
答案 0 :(得分:2)
在Ciuly的网络角上发布了一个工作演示,回答了问题的最后部分: http://www.ciuly.com/delphi/multimedia/using-directshow-with-dspack-play-multimedia-content-from-stream/
至于其他两个部分,加载到数据库blob字段并从中读取:
//add a file stream to a blob field
MemoryStream:= TMemoryStream.Create;
try
MemoryStream.LoadFromFile(VideoFileName);
MemoryStream.Position:= 0;
ClientDataSet1.Edit;
ClientDataSet1YOURBLOBFIELD.LoadFromStream(MemoryStream);
ClientDataSet1.Post;
finally
MemoryStream.Free;
end;
//read a memory stream from a blob field
MemoryStream:= TMemoryStream.Create;
try
ClientDataSet1YOURBLOBFIELD.SaveToStream(MemoryStream);
MemoryStream.Position:= 0;
//do your magic with the memory stream here
finally
MemoryStream.Free;
end;