-
A stoopid newbie question I'm afraid: I am encoding a live 25 FPS 950x540 H.264 video-only (no audio) stream using the latest (built from source) FFmpeg, 15 segments in the manifest, each of duration 2 seconds, and consuming that stream with the latest If I refresh the browser window when there is no source
Note that the line Obviously I have something fundamentally wrong: can anyone tell me what? Here is a sample
I have tried longer segment lengths (up to 10 seconds), I have set Sorry in advance for bothering everyone, but I've run out of places to ask for advice. FYI, you can get +50 reputation on Stack Overflow if you answer this same question there :-): https://stackoverflow.com/questions/79264387/hls-js-unable-to-maintain-seek-with-live-video-only-stream [Later]: I have modified the FFMpeg stream to ensure that there is always a key frame at the start of every HLS segment (which allows FFmpeg to use floating-point segment lengths and A sample debug log output of the fail case from the browser is also attached, along with a success case to show that I'm not going completely mad. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
And the answer was... tell the FFmpeg At the FFmpeg C API this is done with Why? I couldn't tell you. It has taken me nearly a week of trying everything I could try before I found this. With this single option added, Note that I did try running We live and learn :-). |
Beta Was this translation helpful? Give feedback.
And the answer was... tell the FFmpeg
libx264
video codec to-tune zerolatency
.At the FFmpeg C API this is done with
av_dict_set(&codecOptions, "tune", "zerolatency", 0)
, wherecodecOptions
is theAVDictionary
you will then pass as the last parameter toavcodec_open2()
.Why? I couldn't tell you. It has taken me nearly a week of trying everything I could try before I found this. With this single option added,
hls.js
synchronizes, and re-synchronizes, with the HLS stream every time, under all circumstances. Without it,hls.js
will not gain initial sync to a HLS stream if it is started just a few seconds after the stream has begun and, won't regain synchronization if it should lose it.Note…