Playing a movie using DirectShow from memory?

Started by
2 comments, last by AntonyCoder 17 years, 6 months ago
Is there anyway to load a movie from memory instead of hd using directshow?
Advertisement
Sure; just create a source filter that's not a file, but is a memory stream. I think there's even a sample in the SDK that does something like that.
enum Bool { True, False, FileNotFound };
Great. Thing is I'm using Managed DirectShow Lib called TS or something very similar, have you used it yourself?
And I currently use the function RenderFile to establish the filters used to playback. Am I right in thinking I can use renderfile to create it, then simply change the input filter?

Or would I have to supliment the C# code with a C++ dll?

Here's my code currently, if you could just point me in the right direction(Even more so than you have already :) ) i'd be grateful.
Thanks.

public void BuildFromFile(string file,IntPtr handle)        {            int hr = 0;            graphBuilder.            hr = this.graphBuilder.RenderFile(file, null);            DsError.ThrowExceptionForHR(hr);            SyncInterfaces();            CheckVisibility();            hr = this.mediaEventEx.SetNotifyWindow(handle, WMGraphNotify, IntPtr.Zero);            DsError.ThrowExceptionForHR(hr);         }
Ok just realised that is not possible since RenderFile works only on a string. (Unless there's a C++ one that works from memory not exposed in the C# lib I'm using?)

So I guess my question now is, how do I manually determine which filters etc I need to use to render a file?

This topic is closed to new replies.

Advertisement