<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>26716</bug_id>
          
          <creation_ts>2014-09-02 10:32:47 +0000</creation_ts>
          <short_desc>[InbandTracks] Track order</short_desc>
          <delta_ts>2014-10-30 20:20:20 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>Sourcing In-band Media Resource Tracks</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Cyril Concolato">cyril.concolato</reporter>
          <assigned_to name="Silvia Pfeiffer">silviapfeiffer1</assigned_to>
          <cc>b.lund</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>110854</commentid>
    <comment_count>0</comment_count>
    <who name="Cyril Concolato">cyril.concolato</who>
    <bug_when>2014-09-02 10:32:47 +0000</bug_when>
    <thetext>The specification proposes to define the track order for created tracks. There is no rationale for that and in some cases it does not make sense. What is the benefit of it. In typical DASH or MP4 processing, track order is meaningless. For example for DASH: there is no guarantee that an MPD is not rewritten somewhere in the network, so relying on the order of tracks is error-prone. Similarly, in the MP4 case, tracks may be added by tools without breaking the file playback.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111983</commentid>
    <comment_count>1</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2014-09-22 22:19:25 +0000</bug_when>
    <thetext>We need a track order in HTML. E.g. retrieving videoTracks[3] should always retrieve the same video track from a media file. How do you suggest to do that?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111995</commentid>
    <comment_count>2</comment_count>
    <who name="Cyril Concolato">cyril.concolato</who>
    <bug_when>2014-09-23 06:49:06 +0000</bug_when>
    <thetext>Applications should rely on track ids, not on track order. You shouldn&apos;t use videoTracks[3].</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112003</commentid>
    <comment_count>3</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2014-09-23 08:25:44 +0000</bug_when>
    <thetext>Sure, but not all tracks have an id.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112006</commentid>
    <comment_count>4</comment_count>
    <who name="Cyril Concolato">cyril.concolato</who>
    <bug_when>2014-09-23 08:42:51 +0000</bug_when>
    <thetext>I was considering only container formats and so far MP4, MPEG-2 TS, WebM and Ogg, all have an id for tracks. DASH AdaptationSets indeed may not always have an id, but I don&apos;t think you want to rely on videoTracks[3] to be the third AdaptationSet in the MPD because the MPD may have been filtered in the network, or rewritten by an XML processor and there is no guarantee that the order has been preserved.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112177</commentid>
    <comment_count>5</comment_count>
    <who name="Bob Lund">b.lund</who>
    <bug_when>2014-09-25 16:27:21 +0000</bug_when>
    <thetext>(In reply to Cyril Concolato from comment #4)
&gt; I was considering only container formats and so far MP4, MPEG-2 TS, WebM and
&gt; Ogg, all have an id for tracks. DASH AdaptationSets indeed may not always
&gt; have an id, but I don&apos;t think you want to rely on videoTracks[3] to be the
&gt; third AdaptationSet in the MPD because the MPD may have been filtered in the
&gt; network, or rewritten by an XML processor and there is no guarantee that the
&gt; order has been preserved.

What does &quot;no guarantee that the order has been preserved&quot; mean? The order is whatever is present in the MPD when the UA parses it. It is irrelevant what the MPD state was before the UA gets it. In any case, what is the alternative? Create the tracks in a random order? Would this benefit the application?

This part of the spec is not a suggestion that the application should rely on track order. It is a response to the HTML spec statement &quot;Tracks in AudioTrackList and VideoTrackList objects must be consistently ordered. If the media resource is in a format that defines an order, then that order must be used; otherwise, the order must be the relative order in which the tracks are declared in the media resource. The order used is called the natural order of the list.&quot;

Applications can use the track.id attribute if it is set.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112240</commentid>
    <comment_count>6</comment_count>
    <who name="Cyril Concolato">cyril.concolato</who>
    <bug_when>2014-09-26 08:36:37 +0000</bug_when>
    <thetext>(In reply to Bob Lund from comment #5)
&gt; (In reply to Cyril Concolato from comment #4)
&gt; &gt; I was considering only container formats and so far MP4, MPEG-2 TS, WebM and
&gt; &gt; Ogg, all have an id for tracks. DASH AdaptationSets indeed may not always
&gt; &gt; have an id, but I don&apos;t think you want to rely on videoTracks[3] to be the
&gt; &gt; third AdaptationSet in the MPD because the MPD may have been filtered in the
&gt; &gt; network, or rewritten by an XML processor and there is no guarantee that the
&gt; &gt; order has been preserved.
&gt; 
&gt; What does &quot;no guarantee that the order has been preserved&quot; mean? The order
&gt; is whatever is present in the MPD when the UA parses it. It is irrelevant
&gt; what the MPD state was before the UA gets it. 
What I meant was that if a content producer creates both MPDs and JS to expose the tracks from those MPDs, it shouldn&apos;t hard code in the JS that videoTracks[3] is the 3rd Video AdaptationSet containing video in the original MPD as the MPD might be changed by network entities (Note: such change by network entities is discussed in many forums even if it is debatable). However, you&apos;re right, when the MPD reaches the UA, the order will probably match.

&gt; In any case, what is the
&gt; alternative? Create the tracks in a random order? Would this benefit the
&gt; application?
The alternative is not to say anything about the order. I don&apos;t see the added value of saying that videoTracks[3] is the third AdaptationSet in the MPD that contains video. 

&gt; 
&gt; This part of the spec is not a suggestion that the application should rely
&gt; on track order. 
We should probably make it clearer and suggest that application use either track ids or track characteristics (type, kind ...) to use tracks.

&gt; It is a response to the HTML spec statement &quot;Tracks in
&gt; AudioTrackList and VideoTrackList objects must be consistently ordered.
I had not noticed that statement before. I&apos;m not sure what &quot;consistently&quot; means here. Consistently across what? I can understand that when addtrack or removetrack events on those lists are triggered, you don&apos;t want the complete order to change: a track has been inserted or one has been removed. So in the mappings, that is only relevant to when there are multiple Periods in a MPD and when you want maintain the track order. This is not trivial. We should probably add a section to the spec defining how the mapping behaves in case of period change.
 
&gt; If the media resource is in a format that defines an order, then that order
&gt; must be used; otherwise, the order must be the relative order in which the
&gt; tracks are declared in the media resource. The order used is called the
&gt; natural order of the list.&quot;
The notion of &quot;natural order&quot; seems to be used only to disambiguate which track you get using getTrackById when two tracks have the same id. In our case, this shouldn&apos;t be useful, except maybe when MPDs are invalid and have 2 AdaptationSets with the same id. So indeed, defining the order is useful. We should document the rationale for that. I&apos;ll submit a patch.

&gt; 
&gt; Applications can use the track.id attribute if it is set.
We should encourage to use track.id and other track characteristics.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>113834</commentid>
    <comment_count>7</comment_count>
    <who name="Cyril Concolato">cyril.concolato</who>
    <bug_when>2014-10-28 15:44:06 +0000</bug_when>
    <thetext>Proposed Pull Request:
https://github.com/w3c/HTMLSourcingInbandTracks/pull/31</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114274</commentid>
    <comment_count>8</comment_count>
    <who name="Bob Lund">b.lund</who>
    <bug_when>2014-10-30 20:20:20 +0000</bug_when>
    <thetext>(In reply to Cyril Concolato from comment #7)
&gt; Proposed Pull Request:
&gt; https://github.com/w3c/HTMLSourcingInbandTracks/pull/31

PR accepted.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>