Slow seeking with matroska streaming
Posted: 11 Jul 2004 04:18
Hi!
When streaming a matroska file through HTTP/1.1 and then seeking far out in the file, the VLC generates a lot of requests to the webserver with increasing Range header in stead of going directly anywhere near the actual position in the file where it should start playing.
This results in a long delay when seeking on a remote file, where neither the network bandwidth or CPU seem to be the bottleneck. The effect is not noticable when streaming from localhost however, but are noticable over a fast LAN. This is tested using a fairly recent SVN checkout on Windows platform.
This only seem to effect Matroska container handling, the WMV and ASF container handling does not have this problem.
The way I see it, it should be possible to do a first guess on where to start reading from just by looking at total length in time, total filesize and seek position. If this fails, then one can always fall back to the old way. Any comments?
The web server requests also seem to have an open end in the Range-header, and a Connection: close header. Would it be better to specify how much we want to read and to reuse the connection to the webserver?
We use VLC as a player in a project with an MPEG-7 database prototype with instant streaming of fragments. We have extended VLC with support for playing fragments using #hh:mm:ss-hh:mm:ss or #mm:ss-mm:ss syntax in the URL, and can upload or commit this patch if anyone is interested. We've also enabled VLC as a urlhandler in Windows so that VLC can stream these fragments directly from a vlc:http://the.url link on a webpage. Comments are welcome.
Terje Bakken and Jarle Snertindalen
When streaming a matroska file through HTTP/1.1 and then seeking far out in the file, the VLC generates a lot of requests to the webserver with increasing Range header in stead of going directly anywhere near the actual position in the file where it should start playing.
This results in a long delay when seeking on a remote file, where neither the network bandwidth or CPU seem to be the bottleneck. The effect is not noticable when streaming from localhost however, but are noticable over a fast LAN. This is tested using a fairly recent SVN checkout on Windows platform.
This only seem to effect Matroska container handling, the WMV and ASF container handling does not have this problem.
The way I see it, it should be possible to do a first guess on where to start reading from just by looking at total length in time, total filesize and seek position. If this fails, then one can always fall back to the old way. Any comments?
The web server requests also seem to have an open end in the Range-header, and a Connection: close header. Would it be better to specify how much we want to read and to reuse the connection to the webserver?
We use VLC as a player in a project with an MPEG-7 database prototype with instant streaming of fragments. We have extended VLC with support for playing fragments using #hh:mm:ss-hh:mm:ss or #mm:ss-mm:ss syntax in the URL, and can upload or commit this patch if anyone is interested. We've also enabled VLC as a urlhandler in Windows so that VLC can stream these fragments directly from a vlc:http://the.url link on a webpage. Comments are welcome.
Terje Bakken and Jarle Snertindalen