I am trying to make seamless looping video in a game engine, and I have two questions.
- Even though I used the Sequencer Source, I still found that the playback between two videos is not exactly seamless. I collected some logs and show in the following picture.
Lines 1-8 is the starting of the first video segment, Line 10-25 is about the switching between the first video segment and the second video segment. Line 21 is the topology switching event, and we received frame data at Line 22, this caused about 100ms delay. All the topologies in the sequencer source share the same IMFActivate object. This object is created by MFCreateSampleGrabberSinkActivate. I don't know if any topology nodes should be shared among the topologies, such as output node. So I want to know how to kill the 100ms delay.
2) I implemented looping by appending repeated video segment to the sequencer source. Reference to the documentation, the input list can have duplicate topologies if the application called AppendTopology on the same topology more than once. So I tried appending the same topology twice, but the second one cannot be played normally. I found that I received Ended event right after Started Source event of the second topology. I tried to reuse media source instead of topology, building a different topology with same media source, but still not work. Finally, I build a brand new topology object with a brand new media source object for a same video segment, this worked for me but this is obviously very bad. So how can I reuse the topology object as the documentation said?