How do you get DirectShow to play a video from a r

2019-04-16 02:07发布

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.

2条回答
老娘就宠你
2楼-- · 2019-04-16 02:42

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

查看更多
来,给爷笑一个
3楼-- · 2019-04-16 02:43

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

查看更多
登录 后发表回答