SuRGeoNix / Flyleaf

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

Play Delay #434

Closed zhishiheng closed 4 months ago

zhishiheng commented 4 months ago

I Play RTS stream ,delay 5-8 seconds.What parameters Can I modify to improve it?

zhishiheng commented 4 months ago
 Engine.Start(new EngineConfig()
            {
                FFmpegPath = AppDomain.CurrentDomain.BaseDirectory + "FFmpeg", // @"C:\Flyleaf\FFmpeg",;;
                FFmpegDevices = false,    // Prevents loading avdevice/avfilter dll files. Enable it only if you plan to use dshow/gdigrab etc.

#if RELEASE
                FFmpegLogLevel      = FFmpegLogLevel.Quiet,
                LogLevel            = LogLevel.Quiet,

#else
                FFmpegLogLevel = FFmpegLogLevel.Warning,
                LogLevel = LogLevel.Debug,
                LogOutput ="log.txt",
                //LogOutput         = ":console",
                //LogOutput         = @"C:\Flyleaf\Logs\flyleaf.log",                
#endif

                //PluginsPath       = @"C:\Flyleaf\Plugins",

                UIRefresh = false,    // Required for Activity, BufferedDuration, Stats in combination with Config.Player.Stats = true
                UIRefreshInterval = 250,      // How often (in ms) to notify the UI
                UICurTimePerSecond = true,     // Whether to notify UI for CurTime only when it's second changed or by UIRefreshInterval
            });// ;
SuRGeoNix commented 4 months ago

@zhishiheng Please try to explain what you want when you ask something. There is no RTS protocol (probably RTSP?) and engine's config has nothing to do with the open delay if that's what you ask. Try set Config.Demuxer.AllowFindStreamInfo = false

zhishiheng commented 4 months ago

The mobile phone provides RTS streaming, which can be played on the desktop. The desktop and mobile screens are out of sync and will be delayed by 3-8s.

SuRGeoNix commented 4 months ago

Provide a log file, give a link with the related ffmpeg rts protocol/format, check the config before opening an issue (eg. MaxLatency)

Check more from other issues https://github.com/SuRGeoNix/Flyleaf/issues/388

zhishiheng commented 4 months ago

thank you very much. by the way , if i want to Saves all video frame, Is it feasible for me to use the TakeSnapshotToFile method and then call it every 20 milliseconds with a timer?

SuRGeoNix commented 4 months ago

if you want to save all frames check the extractor sample

zhishiheng commented 4 months ago

if i want to save i frames only how can i do?

zhishiheng commented 4 months ago

What I mean is that while I play the RTS stream, I save the keyframe data

zhishiheng commented 4 months ago

extractor sample work good for mp4,but RTS Stream not work