#38 Variable buffering of network streams

open
nobody
None
5
2007-09-19
2007-09-19
lotan_rm
No

I'm no developer, therefore, I don't know what data is available to the mplayerplug-in.

I assume though, that at least some network streams contain information about the total length of the stream (if the stream is finite).

The second input to my feature is the current download rate.

And, finally, the third input is the average audio/video rate of the stream.

If the average audio/video rate is greater than the current download rate, the plugin is able to determine (assuming that the download rate stays the same), how much data needs to be pre-buffered before it's likely that the stream will play until the end without any interruption due lack of data. An absolute safety margin for that buffer due to jitter in download rates could be introduced.

If the average audio/video rate is smaller than the current download rate, the stream can start playing instantly with the smallest possible buffer.

This feature would provide the best responsiveness versus the least annoyance (due to stutters) on finite streams.

Discussion

  • Kevin DeKorte
    Kevin DeKorte
    2007-09-21

    Logged In: YES
    user_id=685413
    Originator: NO

    That is the problem, about 1/2 the time the data to make these decisions isn't there until later (like after the stream has started playing).

    In gecko-mediaplayer my other video play plugin I've put in an autopause feature, where if the amount downloaded it is to close to the position in the file (percentage wise) then I pause playback until there is more buffer available.

     
  • lotan_rm
    lotan_rm
    2007-09-23

    Logged In: YES
    user_id=1358865
    Originator: YES

    I'm not sure if I understood the autopause feature that you described.

    But wouldn't it be possible to start buffering the stream (without playing) and as soon as there's enough data available to make the aforementioned decisions, apply the "algorithm" that I described above (play or buffer and then play).

    If I just described what the autopause feature does, then the interpretation of my feature request is good.

     
  • Kevin DeKorte
    Kevin DeKorte
    2007-09-23

    Logged In: YES
    user_id=685413
    Originator: NO

    That is pretty much what mplayerplug-in is doing. It has making sure that enough data is present to playback at least a little bit of the file. Generally that "little bit" is based on the cache size parameter. That is why I made it tuneable. If you are on a slow connection generally you need more cache than someone on a fast connection.

    see the cachesize and cache-percent options in the config files. I would recommend against completely disabling the cache as in most cases sites just don't work. And unless you and the site you are looking at have very fast pipes. Setting the cache to under 512 is unreliable.

     
  • Logged In: NO

    If I understand correctly, cache size is a fixed absolute value and cache-percent bases the cache size on the total "file size" (stream size).

    My feature takes the cache-percent feature one step further in taking into consideration the actual download rate and the audio/video rate of the material that is to be played in order to find out the best suited buffer size for that particular stream. This size of this buffer would be calculated to be different for different streams, which is why I called it variable buffering.