Help: stream is constantly buffering, libmpv sends TCP RESET

No, this is the overhead of the format.

Take as an example where a file has all the video data at the beginning and all the audio data at the end. To play this, the client must read some video data, seek to where the audio data is, read some there, seek back to the video, read some, seek back to the audio, etc. There’s a bunch of seeking back and forth. A properly interleaved file has the audio and video data mixed together in the file so that the video at time 1:00 and the audio at time 1:00 are right next to each other. So the player doesn’t need to seek at all but rather can just linearly read the file.

It’s the seek back/forth that’s causing the bandwidth usage and problems. Seeking back/forth on a file stored on your PC isn’t really much of an issue (even with spinning HDs) but over a network it’s a killer and wastes a lot of bandwidth.

When you run the mkv conversion or the ffmpeg -vcodec copy, that command will do the many seeks required on the file and give you a resulting file that is properly interleaved. It’s copying the audio/video data as it is in the original file but placing it in proper positions in the file so the client playing the resulting file doesn’t need to seek all over the place to play it.

1 Like