Hello,
I have some trouble finding how to make the following :
I have one video file and 5 audio files (mp4 and mp3) that must play at the same time, and I need to be able to select a section of the full length (for instance from 5 sec to 10 sec) and make it loop seamlessly.
I have tried the following, but with no success :
- By using one topology, restarting the playback on the end of presentation event : it works but only for the whole file. If I use the MF_TOPONODE_MEDIASTART/STOP, then it does no more loop.
- I try to add 4 times the same unique topology (the one that contains all the nodes for playing the files together). Here I can use the MF_TOPONODE_MEDIASTART/STOP, but it only plays it once, then the session ends. I have well placed the SequencerTopologyFlags_Last only for the last AppendTopology. I receive the various MENewPresentation and MF_TOPOSTATUS_SINK_SWITCHED, but it only is played once. Is it possible to add the same topology several times ?
Do we need to create separate topologies built totally independently ? Or in this case, would it be enough to create 2 topologies and use them alternatively ?
I would appreciate some advice on that.
Dominique
+++++++++++++++++++
Following the above, I have tried to create 10 topologies that are totally independent, using the same set of files. I can use the MF_TOPONODE_MEDIASTART/STOP and the 10 topologies play, but it is not seamless. There is a freezing of the video and audio for something like 0.5 to 1 sec between each segment.
I read in the forum at some place that in order to make the transition seamless, we need to use the same sink nodes for the topologies. However, I am not sure how to achieve that. One topology uses 7 output nodes (1 video and its sound track+ 5 audio tracks). So I setup the first topology by creating the 7 nodes. Then for the other topologies, I use the same 7 nodes in the pSourceNode->ConnectOutput(0, pOutputNode, 0)
Doing that, after a few times, the ConnectOutput crashes. Can we connect several source nodes to the same output node ?
Then I tried to create 7 sink activation objects with CreateMediaSinkActivate(pSD, hVideoWnd, &pSinkActivate)
and I used these 7 sink activation objects to create the output nodes (10 x 7 nodes).
Is this the correct way ?
This works and plays but again, it is not seamless, there is still some glitch during the transition. I tried using only the video and one audio file and it seems to improve the glitch condition, but not totally. It seems to be influenced by the number of files. I am using an mp4 video and mp3 audio files.
Am I missing something ? Some advise would be welcome ...:->