Media Player video seqance with no delay?
I want to play a sequence of videos or image seqances in UE. I’m using Media Player and Playlist. I’m a beginner, so I apologise if I missed something obvious in my approach.
The Project is to display video/image sequence on a static mesh. You press Enter to start playback of Video 1. If player don’t do anything, then once Video 1 finishes Video 2 will start. However if player press Input Key “3” during playback of Video 1, than Video 3 will start after Video 1 ends.
Once I get this 100% working there will more videos to be included for longer experience.
My BluePrint so far:
I'm on UE 4.18.1.
There is no built-in support for playing multiple videos seamlessly right now. The decoders will need some time to load and decode the beginning of a video, so the only way to make this work is to start decoding the next video ahead of time. Some media APIs, such as WMF, have support for this, but we haven't implemented it, and I can't say whether it will be implemented anytime soon or ever. You can emulate this behavior yourself by creating multiple players, start playback and then pause them right away. Then continue playback when their time comes, and switch over the MediaTexture to pull frames from the new player.
Image sequences have the advantage that there is very little overhead for decoding them. This also makes them much bigger than compressed video containers, such as MP4.
JPG, PNG and BMP use our legacy image loader in UE4, which is extremely slow. For 4k plates in particular you're going to see substantial slowdowns. They won't play in real-time. If you want fast image sequences at high resolutions, you should use EXR instead, because we use a multi-threaded and highly optimized EXR reader. You will still need a computer with very high memory bandwidth. Needless to say, these kinds videos will also take an awful lot of room on your hard drive. Either way, for fast accurate video playback, EXRs are your best bet.
You cannot get the duration of videos unless they are opened in a media player. Once the media is opened, you can use MediaPlayer.GetDuration.
There is no good way to do this right now. You'll have to open the media in each player, then call Pause. If you're lucky, this will prefetch the first few frames. Then, after some delay, you call Play on all players. You can also try Seek. In 4.18 there is a new callback called OnSeekCompleted that will notify when the seek operation is complete. You can wait for all players to be done, then call Play.
We are currently working on integration Media Framework with Sequencer. Sequencer will then take care of things like precaching and synchronizing multiple players.
answered Nov 22 '17 at 06:14 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here