Search code examples
visual-c++directshowvideo-capture

Directshow GMFBridge in VC++


I have one mp4 Capture application , that continuously capture graph for 30 min (or some dynamic value) , i need the capture accuracy very high tso that do not loss a freq. of data.

For that we decided to make 2 capture graph , run the first graph first , then after 30 min make 2nd graph , run it and and then stop first graph , so we do not loose any data.

in simple manner we do not able to create second graph as first graph is running and resources are in use (almost this is the reason for our logic not working i guess)

i was surfing for it and found the GMFBridge , which i guess can be useful in our case, i am thinking of to make process as below

Source Graph

Video Source --> XCodec Filter --> Infinite tee --> GMF Bridge Sink Filter (multile as per tee)-->

Audio Source --> ACM Wrapper --> MonoGraph AAC Encodec --> Infinite Tee (multile as per tee)--> GMF Bridge Sink Filter -->

First Graph

  --> GMF Source Filter -->  GDCL Mux --> Filter Writer

Second Graph

  --> GMF Source Filter -->  GDCL Mux --> Filter Writer

Now using GMFBridge we'll make the source to use only once and make duplicates of it using Infinite Pin Tee Filter , and make application that conncets Source Graph to First Graph and Source Graph to Second Graph .

And first run combination of Source Graph to First Graph and after 30 mins run combination of Source Graph to First Graph and then stop that graph.

I wonder that is my understanding is proper?? can i achieve this using GMFbridge. and also i need simple code for GMFBridge other than provided on their sample application.

Please help on this.

Thanks


Solution

  • You would only add one GMF Bridge Sink Filter to the source graph. If you need multiple streams, you can configure the bridge to have multiple streams. But it does not make sense to put a Infinite tee in it just because you need it twice.

    what you do is:

    • start the source graph.
    • start the first graph
    • connect the source with the first graph
    • start the second graph
    • (after 30 minutes) connect the source graph with the second graph
    • stop the first graph
    • ...

    This way you won't lose any samples, the first 30 minutes all samples go to the first graph. From the moment you switch, all samples go to the second graph.