Skip to content

Feature request: keep HLS stream alive even if source stops updating #364

@yesthatjwz

Description

@yesthatjwz

Sometimes my video source is unable to keep streaming to nginx-rtmp due to network errors or other problems. In that case, I would prefer for the stream, as seen by the end users, to continue streaming instead of hanging up.

As it is now, when the source goes away, the number of segments listed in the m3u8 file will begin to decrease, and when they reach zero, the m3u8 file itself goes away and becomes 404. Then the end user's player goes into a "stop" state, and they have to hit "play" again some time later to get it to resume.

What I would like to do, is to be able to configure a single static .ts file containing a looping video of colorbars, and when no "live" upstream segments are available, leave the m3u8 file with one or more copies of that "colorbars" segment in it; and then for it to go back to the normal segments once the real upstream source returns. The trick, of course, is that to make this work, the sequence number has to keep increasing. So trying to fake this out using location / try_files can't work; I think this feature would have to be built into nginx-rtmp itself to work. (I experimented a bit here.)

In this new model, the end user's player would stay in the "play" state the whole time, just with some colorbars in the middle, and they would not have to manually hit "play" again once the source came back online.

I hope you'll consider it. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions