I have tried to use Kodi to play files which are in the process of being downloaded so that I don’t have to wait until the stream is done, but it only partially works…
On my Ubuntu server I download various internet video streams to mp4 files for later viewing via OSMC on a number of RaspberryPi devices and that has worked fine for years.
But there has been the problem that I cannot view them until the download finishes and the mp4 file is properly closed. And that is because the mp4 file format has some kind of marker (called moov) that is only written by ffmpeg at the finish of a file download.
So I tried to change the download target from mp4 to the ts type instead and Kodi initially seems happy to play these files. But only for a while…
After some testing I have found that in the following situation playback is erratic:
- Start downloading the stream to a ts type video file
- Wait say 5 minutes and then navigate to the file in Kodi and play it
- After 5 minutes the playback still works but behaves erratically when using pause, jump back and jump forward commands.
- Stop the playback and re-open the file again
- Now playback seems to be OK until you jump or play forward to the time corresponding to file length at the time you re-started playing it, then the problems re-appear.
It seems like the problem is that Kodi does not check the current length of the file when playing it, it looks like it uses the length at the time playback started as the immutable video length even though the file grows.
Is there some setting that can tell Kodi to update the video length while playing a file that is of type ts (or other file formats that can be written and played at the same time)?