sonroyaalmerol / m3u-stream-merger-proxy

A lightweight HTTP proxy server dockerized for consolidating and streaming content from multiple IPTV M3U playlists, acting as a load balancer between provided sources.
https://hub.docker.com/r/sonroyaalmerol/m3u-stream-merger-proxy
27 stars 3 forks source link

Follow ffmpeg's buffer behavior to reduce playback issues on slow connections #164

Open sonroyaalmerol opened 2 hours ago

sonroyaalmerol commented 2 hours ago

Is your feature request related to a problem? Please describe.

When streaming live video, playback issues occur due to buffering delays and inconsistent chunk delivery from the provider's server, especially on slow connections. The proxy currently serves chunks to the client immediately after they are inserted into the buffer and the client requests arrive. This doesn't mitigate issues caused by slow or inconsistent chunk delivery, as the player may still run out of chunks, leading to playback stalls or repeated content.

Describe the solution you'd like

I'd like the proxy to implement a more robust buffering system similar to how ffmpeg handles streams. Instead of serving chunks immediately on client request, the proxy should accumulate data in the buffer until a sufficient amount is available before starting playback. This would help smooth out inconsistencies in chunk delivery, ensuring that the player has a steady stream of data even when the server is slow or delivering chunks inconsistently.

Additional context

At the moment, the proxy doesn’t hold data in the buffer for long, which makes it vulnerable to playback issues when chunk delivery is slow or erratic. By improving the buffer system to hold onto more data before serving, the proxy can better handle server-side delays without affecting the client’s playback experience. However, it’s important to note that while this can improve playback stability, it may not fully resolve streaming issues on extremely slow connections.

aniel300 commented 2 hours ago

just play around. if u hit a dead end, etc that is fine. don't spend too much time on this as there only so much u can do. regardless i can't be thankful enough because u are giving this a try and are putting up with my ignorance, thanks again.