How do you get DirectShow to play a video from a resource?

喜欢而已 提交于 2019-12-22 00:23:30

问题


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.


回答1:


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




回答2:


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



来源:https://stackoverflow.com/questions/530998/how-do-you-get-directshow-to-play-a-video-from-a-resource

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!