Quantcast
Channel: Media Foundation Development for Windows Desktop forum
Viewing all articles
Browse latest Browse all 1079

How to achieve smooth video looping ?

$
0
0

Hello,

My application must read one video track and several audio tracks, and be able to specify one section of the file and play it in loop.  I have created a setup with Media Foundation, using the sequencer source and creating several topologies with the start and end point of the section I want to loop.  It works, except for the fact that there is a 0.5 to 1 sec time of stabilization of the playback just when it goes back to the starting point.

First, I made it with individual audio files and one video file.  This was quite bad for some files, sometimes all the files were completely out of sync, sometimes the video was frozen for several seconds, then went very fast to catch with the audio.

I had a good improvement using only one file, that includes the video and the multiple audio tracks.  However, for most files, there is still a problem about the smoothness of the transition.

With a poor quality video AVI file, I could make it work smoothly, which would mean that the method I use is correct.  I have noticed that the quality of the loop smoothness is strongly related to the CPU used on a file when simply playing it.

I use the "SetTopology" on the session, using a series of topologies, so normally it should preroll the next one during the playback of the current one, right ?  Or am I missing something there ?

My app works also on Mac, where I have used a similar setup with AVFoundation, and it works fine with the same media files I use on Windows.

What can I do to have the looping work smoothly with better quality video on Windows ?  Is there something to do about it ?  

When I play the media file without looping, I notice that when I preroll it to some point, then when I hit the START button, the media starts instantly and with no glitch.  Could it work better if I was using two independent simple playback setups, start the first, preroll the second, then stop the first and start the second programmatically at the looping point ?


Viewing all articles
Browse latest Browse all 1079

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>