xTeVe icon indicating copy to clipboard operation
xTeVe copied to clipboard

2nd client connecting to an existing stream will be start at the beggining of the buffered stream (using ffmpeg)

Open stevehop opened this issue 3 years ago • 2 comments

Describe the bug When a second client connects to a stream that is already being watched the second client will start watching video from the start of the buffer which can be significantly behind. This is particularly annoying if the stream fails for some reason as when restarting the stream on the first client you are shown previously watched content.

Server (please complete the following information):

  • Windows Server 2012 R2
  • Intel 64 Bit
  • xTeVe 2.2.0

To Reproduce Steps to reproduce the behavior:

  1. Open a stream using any client
  2. Watch for several minutes
  3. Open the same stream using a separate client
  4. Video will start from several minutes behind

Expected behavior Stream for the second client will start nearer to the end of the buffered stream

Additional context Buffer Size: 3MB

Timeout for new client connections: 200

FFmpeg Options: -hide_banner -loglevel error -i [URL] -map 0 -map -0:m:language:NAR? -map -0:m:language:nar? -ignore_unknown -c copy -f mpegts pipe:1

stevehop avatar Apr 25 '21 13:04 stevehop

I know it's been a year since this was reported, but I'm seeing the same thing.

joshjryan avatar Apr 17 '22 04:04 joshjryan

My assumption is that when reading from the TEMP directory for a new client, it should only be using the most-recent ts. But, also of note: I've noticed that when I watch a channel for a while, the TEMP directory just grows and grows. If I'm reading buffer.go correctly, it looks like only 20 TS files should be kept, but I'm regularly seeing 100s of TS files for one channel.

joshjryan avatar Apr 17 '22 12:04 joshjryan