Pergunta

I've used directshow sample grabber for grabbing a video frame and also for playing. This time I would like to trans-code from one video format to other. I'm again planning to use directshow for this. My filter graph would be something like this.

Source Filter ---> Sample Grabber --> File Writer. I would like to know is the above graph ok, or do I need to add something else.

Also while going through MSDN, I found Windows Media Foundation is going to replace DirectShow. I would like if I switching to Media Foundation is good idea or not.

Thanks Pradeep

Foi útil?

Solução

Sample grabber let's you copy and inplace modify data coming through. This is typically insufficient for transcoding because you cannot inject new data into the pipeline. However if the source file is well playable, this time you might be fine with readily available filter without need to write your own: you will just build a pipeline and started graph will do the transcoding.

Windows Media Foundation is going to replace DirectShow. I would like if I switching to Media Foundation is good idea or not.

MF was to supersede DShow years ago: Migrating from DirectShow to Media Foundation -- July 2006. Seven years passed, and MF is still not on par with DirectShow on desktop...

These are two APIs coming side by side: use whatever is appropriate. Take into consideration media APIs you already use, target platforms, availability of third party components for extensibility you might need.

FYI, Windows SDK offers you Transcode Sample:

\Samples\multimedia\mediafoundation\Transcode

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top