befovy / fijkplayer

ijkplayer for flutter. ijkplayer 的 flutter 封装。 Flutter video/audio player. Flutter media player plugin for android/iOS based on ijkplayer. fijkplayer 是基于 ijkplayer 封装的 flutter 媒体播放器,开箱即用,无需编译 ijkplayer
https://fijkplayer.befovy.com
MIT License
1.65k stars 354 forks source link

长时间播放rtsp流延迟会越来越严重 #640

Open fmtlyw opened 3 weeks ago

fmtlyw commented 3 weeks ago

通过热点连接设备,然后在Android系统上播放rtsp流,一开始会延迟1秒左右,后面随着播放的时间延时会越来越长,请问该需要怎么优化,让延时一直维持在几百毫秒, 谢谢 下面是配制参数 player.setOption(FijkOption.playerCategory, "mediacodec-hevc", 1); player.setOption(FijkOption.playerCategory, "framedrop", 1); player.setOption(FijkOption.playerCategory, "start-on-prepared", 0); player.setOption(FijkOption.playerCategory, "opensles", 0); player.setOption(FijkOption.playerCategory, "mediacodec", 0); player.setOption(FijkOption.playerCategory, "start-on-prepared", 1); player.setOption(FijkOption.playerCategory, "packet-buffering", 0); player.setOption(FijkOption.playerCategory, "mediacodec-auto-rotate", 0); player.setOption( FijkOption.playerCategory, "mediacodec-handle-resolution-change", 0); player.setOption(FijkOption.playerCategory, "min-frames", 2); player.setOption(FijkOption.playerCategory, "max_cached_duration", 3); player.setOption(FijkOption.playerCategory, "infbuf", 1); player.setOption(FijkOption.playerCategory, "reconnect", 5); player.setOption(FijkOption.playerCategory, "framedrop", 5);

player.setOption(FijkOption.formatCategory, "rtsp_transport", 'tcp');
player.setOption(FijkOption.formatCategory, "http-detect-range-support", 0);
player.setOption(FijkOption.formatCategory, "analyzeduration", 1);
player.setOption(FijkOption.formatCategory, "rtsp_flags", "prefer_tcp");
player.setOption(FijkOption.formatCategory, "buffer_size", 1024);
player.setOption(FijkOption.formatCategory, "max-fps", 0);
player.setOption(FijkOption.formatCategory, "analyzemaxduration", 50);
player.setOption(FijkOption.formatCategory, "dns_cache_clear", 1);
player.setOption(FijkOption.formatCategory, "flush_packets", 1);
player.setOption(FijkOption.formatCategory, "max-buffer-size", 0);
player.setOption(FijkOption.formatCategory, "fflags", "nobuffer");
player.setOption(FijkOption.formatCategory, "probesize", 200);
player.setOption(FijkOption.formatCategory, "http-detect-range-support", 0);

player.setOption(FijkOption.codecCategory, "skip_loop_filter", 48);
player.setOption(FijkOption.codecCategory, "skip_frame", 0);

ijkplayer版本:0.11.0 Android系统:Android10