I'm trying to create an application with Qt that plays some MKV files. I have the part that downloads these mkv files, and of course I do not want to wait until it's completely finished. I think the right term would be to "stream" it.
Since all downloaded files are in the mkv format, I have looked in the libraries libebml and libmatroska. I think I should be able to stream these video files by reading the ebml header of the mkv file and seeing together with the torrent downloader which parts have already been downloaded and depending on which the next frames are playing.
I looked at the MkvToolNix tool, which contains a lot of information. I thought I could check if the next cluster (a set of frames) was downloaded. I also get the byte location and size of this cluster so I can ask the downloader if that part has already been downloaded, and then I'll play the next cluster. But I'm not sure if my strategy is right or if I have to be so deep and technical.
My problem is that I do not know how to best stream a movie and if my method is correct or not. I also use MPV as my video player and libtorrent to download the torrents.