How to play multiple videos while synchronizing multiple monitors using directshow?

I was able to successfully sync up to 8 videos using a single video window with multiple streams using directshowlib for C #. The problem is that the video window plays only on one screen - when I try to cover it on many screens, it does not work. The application window runs correctly, but the video only plays on one screen. Any ideas?

Thank you very much in advance.

+6
c # directshow
source share
1 answer

I assume you are using VMR with multiple input pins. VMR will be displayed on one surface, which should be on one display. You should be able to transfer your threads to multiple VMRs, with each VMR being placed on a separate display in your maximum window.

It sounds as if you have all the threads in one chart. You can divide them into different graphs, with each graph having one source and one renderer. Running graphs in synchronization means using IMediaFilter :: Run instead of IMediaControl :: Run:

  • Select one graph as a wizard.
  • Make sure the wizard has a watch. This is usually done with an active action, but you can make it happen earlier by calling SetDefaultSyncSource on the chart.
  • Request graphs for IMediaFilter, get the clock from the main graph using GetSyncSource and transfer it to other graphs using SetSyncSource.
  • Pause all schedules.
  • Wait until GetState returns S_OK (pause completed).
  • Get the time from the graph and add 10 ms or so.
  • Call IMediaFilter :: execute on all graphs, skipping this time (now + 10 ms) as a parameter.
+11
source share

All Articles