I have disabled gop cache,but the time of requesting for http-flv first frame is too long.
Sectran opened this issue · 3 comments
I disabled gopcache,and I use tcpdump to watch when the first frame will arrive,it's cost a lot of time,plz give me some advices.
When I wait for a long time, the streaming server begain sends the FLV data.
this is my config:
rtmp {
server {
listen 1935;
chunk_size 4096;
max_message 100M;
application video {
play /data/video;
}
application live{
live on;
gop_cache off;
drop_idle_publisher 300s;
recorder rec {
record all manual;
record_suffix ^%Y-%m.flv;
record_path /data/video;
record_unique off;
record_append on;
}
# exec_record_done './convert_flv.sh' $dirname $path $basename 2>>/tmp/rtmp_exec.log;
}
}
}
I don't know why there was a large interval between the request and the response in your test.
An HTTP response is actually driven by a rtmp publisher, if the media file pushed by a publisher has a low bit rate, it will take server some time to coalesce many chunks into a message, then the server calls the relevant handler to feed response. However, this is a trivial factor. The interval between HTTP request and response is normally at ms level, but if the directive gop_cache is off, and if the gop size is large and the request comes after the key frame in the pushing stream, player may wait a long time before a key frame arrives. Further, the directive wait_key is on by default, the server will not send any data after sending HTTP response until a key frame arrives.
yes,in my test, publisher sends every frame in 50 secends,whethere there has an impact on the waiting time of the first frame if I disable wait_key ?
@winshining Thank you very much. Your suggestions have given me a lot of inspiration. After increasing the frequency of keyframes, the loading speed has indeed accelerated. I really appreciate it.