"RokuMarkn" wrote:
Each segment in an HLS stream is a transport stream, and it's not possible to seek within a transport stream. So the seek granularity in an HLS stream is 10 seconds (or whatever the segment duration is). You can't seek with finer resolution than that. (This is not much different than MP4 files, in which you can only seek to the resolution provided by the I-frames in the stream.)
"RokuMarkn" wrote:
I'm not sure I quite understand the question -- let me rephrase what I said. You can seek to any TS file that's in the m3u8, but you can't seek anywhere in a TS file except to the beginning of it. So if your TS files are 10 seconds long and they're all listed in the m3u8, you can seek to location 0, location 10s, location 20s, etc. but you couldn't seek to 15s since that's not the start of a TS file.
--Mark
"RokuMarkn" wrote:
Each segment in an HLS stream is a transport stream, and it's not possible to seek within a transport stream. So the seek granularity in an HLS stream is 10 seconds (or whatever the segment duration is). You can't seek with finer resolution than that. (This is not much different than MP4 files, in which you can only seek to the resolution provided by the I-frames in the stream.)
I doubt that you'll be able to pause at the rebuffer as you're suggesting. When you receive the rebuffer status message, the stream has already stopped playing and the pause isn't going to do anything, I think. You might try adjusting your server to transcode more segments initially, before it starts playing.
--Mark
"scyber" wrote:
I have a transcoding server that is converting video feeds into HLS files. Playback is working, however at times the playback will rebuffer and "skip" back a number of seconds. It appears that if the transcoding server is not fast enough to transcode in real-time, the Roku will reach the end of m3u8 file and then skip back to the beginning of its buffer. Depending on the speed of the server, one rebuffer is sometimes enough to play through till the end of the video.
If my diagnosis of the behavior is correct, is there an event I can catch to simply pause the video when it runs out of video? Pausing would at least been a preferred behavior to "skipping" back.
"retrotom" wrote:
So first, you keep asking the transcoding server how many segments are ready until you fill a buffer -- then you begin playback. The second thing you can do is keep track of how long it took to fill the buffer (from the roku side). We're still playing with this, but if it takes you more than 60-70 seconds to fill 60 seconds of video -- you KNOW you can't keep up with playback. Lastly, you can send the same request everytime the roku hits its HLS target duration (using streamposition). Based on that status message, you should be able to detect upcoming buffer underruns. For instance -- if your buffer is 6 segments...and the status message drops to 4 segments available (or maybe even 3)...then you probably want to pause or warn the user with some kind of visual overlay. We're thinking about using a flashing yellow warning to let them know that "hey...your computer can't keep up". I wouldn't freak out if the value dropped to 5 because sometimes key frames don't arrive in a tight enough duration -- so anything less than 75% fill rate is my cutoff. To clarify, when I say "buffer" -- I mean minimum number of segments available for immediate playback.