0

Is there a way to successfully change the order of the segments after their creation and the MPD? Simply changing the order in the MPD doesn't work as the video player gets a strange behavior. I'm guessing it's something related to the segment's file internals such as the sequence number, presentation time or the initialization segment but I can't seem to figure it out. How do you implement the order in the player?

Pedro Romano Barbosa
  • 587
  • 3
  • 11
  • 29

1 Answers1

1

Presumably you are using a Media Source Extensions (MSE)-based client since you also asked this on the dash.js mailing list.

For mp4, MSE defaults to 'segments' mode which means that the timestamps in the media segments are used to determine playback order, not the order in which they are appended - this is why simply reordering them in the manifest does not work, and would probably lead to buffering issues when media with the expected playback time is not available.

It's unlikely any player does or will implement the behaviour you are looking for - the simplest way to get this working will be to repackage each media segment, essentially just adjusting the baseMediaDecodeTime to be correct for the order you are trying to achieve.

Anonymous Coward
  • 1,096
  • 11
  • 22
  • I'm using dash.js player, you are correct. I had changed some fields in the sidx box, but I forgot the tfdt field, baseMediaDecodeTime. Is changing this field enough for the player to behave the way I want? Or I also have to change the sequence_number, earliest_presentation_time or other parameters? – Pedro Romano Barbosa Feb 27 '18 at 14:08
  • Ah, I assumed you were using the live profile. You do also need to change the earliest_presentation_time if you are using ondemand profile. Note that MSE ignores the sidx, but dash.js does use it so you need to change both the earliest_presentation_time and the baseMediaDecodeTime. In theory the sequence_number need not be changed, but I note some code in the closed caption parser which seems to rely on it so it would probably be sensible to change that too since you are repackaging anyway. – Anonymous Coward Feb 28 '18 at 08:53
  • In my case, only changing the baseMediaDecodeTime did the work, but I agree on changing the other fields as well – Pedro Romano Barbosa Feb 28 '18 at 09:33