问题
I have implemented a Videoplayer using Qt5.1 QMediaPlayer, however I would like to know if there is a way to control the buffer sizes for streaming media from a URL so as to cater for different connection speeds. In addition, is there a way to determine how much of the content being streamed has been completely downloaded.
回答1:
The buffer size is based on the keyframes contained in the video track, the range between 2 keyframes defines the size of each buffered piece and as far as I know this value cannot be modifed in any way from the client-side, the source video should be re-encoded with different parameters in order to modify the size of the buffering pieces. By any chance, are you using x264? if so, you should read about keyint
and min-keyint
from MeWiki, lower keyint = shorter buffered pieces.
来源:https://stackoverflow.com/questions/17920248/changing-buffer-size-of-qmediaplayer