fsplayer icon indicating copy to clipboard operation
fsplayer copied to clipboard

如何设置播放器加载超时时长?

Open LarryLee opened this issue 6 months ago • 6 comments

@debugly 请问时通过format-opts : timeout = XXXX来修改播放器加载超时时长吗?修改了这个值没有效果哦,现在默认超时时长应该是1分钟左右。

默认参数如下: [FSPlayer]actual ffmpeg: n7.1.1-31-g23e2505,but expect: n7.1.1-30 [FSPlayer]===== versions ===== [FSPlayer]ijkplayer : 35d01d1 [FSPlayer]FFmpeg : n7.1.1-31-g23e2505 [FSPlayer]libavutil : 59.39.100 [FSPlayer]libavcodec : 61.19.101 [FSPlayer]libavformat : 61.7.100 [FSPlayer]libswscale : 8.3.100 [FSPlayer]libswresample: 5.3.100 [FSPlayer]===== options ===== [FSPlayer]player-opts : icy-update-period = 3500 [FSPlayer]player-opts : overlay-format = fcc-_es2 [FSPlayer]player-opts : video-pictq-size = 6 [FSPlayer]player-opts : subtitle-font-size = 24 [FSPlayer]player-opts : min-frames = 50000 [FSPlayer]player-opts : enable-cvpixelbufferpool = 0 [FSPlayer]player-opts : enable-accurate-seek = 1 [FSPlayer]player-opts : max-fps = 30 [FSPlayer]player-opts : framedrop = 1 [FSPlayer]player-opts : packet-buffering = 1 [FSPlayer]player-opts : subtitle-outline-color = 0x000000FF [FSPlayer]player-opts : videotoolbox_hwaccel = 1 [FSPlayer]player-opts : copy_hw_frame = 1 [FSPlayer]player-opts : subtitle-font-color = 0xFFFFFFFF [FSPlayer]player-opts : accurate-seek-timeout = 100 [FSPlayer]player-opts : subtitle-font-name = PingFangSC-Regular [FSPlayer]player-opts : start-on-prepared = 0 [FSPlayer]format-opts : ijkapplication = 0x1385fa000 [FSPlayer]format-opts : ijkiomanager = 5241127552 [FSPlayer]format-opts : protocol_whitelist = ijkio,ijkhttphook,concat,http,tcp,https,tls,file,bluray,smb2,dvd,rtmp,rtsp,rtp,srtp,udp [FSPlayer]format-opts : seek_flag_keyframe = 1 [FSPlayer]format-opts : auto_convert = 0 [FSPlayer]format-opts : user_agent = ijkplayer [FSPlayer]format-opts : probesize = 10000000 [FSPlayer]format-opts : timeout = 30000000 [FSPlayer]format-opts : reconnect = 1 [FSPlayer]format-opts : safe = 0 [FSPlayer]===================

LarryLee avatar Jul 29 '25 06:07 LarryLee

设置下 connect_timeout 试试。

debugly avatar Jul 29 '25 06:07 debugly

[options setPlayerOptionIntValue:1 * 1000 forKey:@"connect_timeout"];
[options setFormatOptionIntValue:1 * 1000 forKey:@"connect_timeout"]; 还是没有什么效果哦。

LarryLee avatar Jul 29 '25 06:07 LarryLee

如何测试的?流地址实际上能通吗?

debugly avatar Jul 29 '25 13:07 debugly

使用G网环境加载了一个只能在局域网访问的SMB链接(链接是正确的),超时时长还是在1分钟左右。

LarryLee avatar Jul 29 '25 13:07 LarryLee

每个协议都不一样,上面说的是http协议的。 smb协议的超时可以在 url 的query 参数里添加 &timeout=3 这种形式来指定,单位是秒。

debugly avatar Jul 30 '25 04:07 debugly

感谢回复,试了一下感觉还是没有用。 链接:smb2://username:[email protected]/%E5%BD%B1%E8%A7%86/04.mkv?timeout=3

LarryLee avatar Jul 30 '25 07:07 LarryLee