Skip to content

Unable to join my own live stream part way through #6899

Closed Answered by RobMeades
RobMeades asked this question in Q&A
Discussion options

You must be logged in to vote

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), where codecOptions is the AVDictionary you will then pass as the last parameter to avcodec_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…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by RobMeades
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant