SuRGeoNix / Flyleaf

Media Player .NET Library for WinUI 3/ WPF/WinForms (based on FFmpeg/DirectX)
GNU Lesser General Public License v3.0
711 stars 98 forks source link

How can I play two video files (local mp4 files) sequentially without see any "video cut" between them? #341

Closed robertorossinivigilate closed 1 year ago

robertorossinivigilate commented 1 year ago

Hello @SuRGeoNix, I'm trying to implement some kind of trick that allow me to show two sequentially mp4 files without any "video cut" between them. In order to obtain that, I register my player to Player.PropertyChanged, and then I check if Status property is Status.Ended, an then do Player.Open on my next file. However, there is always a black frame (about 10 ms, variable) between them. Is there a way to obtain a continuous playback of the two mp4? I'm using FlyleafLib for .net framework 4.7, on a WPF application. Thank you for your precious help.

SuRGeoNix commented 1 year ago

Hi @robertorossinivigilate,

Here few things that you can try:-

1) Use Config.Video.ClearScreenOnOpen = true (I think that was the purpose even it should be opposite, I will review this) 2) Use two FlyleafHosts and hide the first and show the second one 3) Pre-open the next input to avoid delays on opening so it will be ready (possible disable AutoOpen to control it manually) 4) Check current time based on duration and do the exchange a bit earlier (instead of testing status ended which is not always valid, can be buffer failed - happens sometimes) (you can check this on property changed for CurTime)