views:

589

answers:

2

I'm extending an application to play one of several videos on a control in a dialog. Starting with the Windowless sample, I've got this working, though the videos have to be separate files from the main executable.

The ideal scenario from a packaging standpoint is for the videos to be included with the executable as resources. I did a bit of googling for this, and there's a fair amount of "somebody should do this", and several pointers to the Async sample, though it's not clear how to get where I want from there.

Does anybody know a simple way to do this? It doesn't seem like this is a corner case, and I'm a bit surprised that this wasn't in the box.

A: 

Why don't you extract the video from the EXE/DLL and store it in the temp path? Then play the temp file.

Sam Saffron
One of the reasons I want to embed the videos is so I can cache them in memory. The current solution has a ~750ms delay when switching videos, which is rather jarring for the user, since it ties up the UI thread.
Ben Straub
But you could extract them all to the temp path on startup in a background thread ... (or programdata)
Sam Saffron
+2  A: 

Look for Async Filter Sample in the DirectShow SDK, It has impl something called CMemStream which can stream data (read: media) from memory. more info on this blog post

Shay Erlichmen