On Fri, Aug 20, 2010 at 9:58 AM, Ian Hickson <span dir="ltr"><<a href="mailto:ian@hixie.ch">ian@hixie.ch</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">On Sat, 22 May 2010, Carlos Andrés Solís wrote:<br>
><br>
> Imagine a hypothetical website that delivers videos in multiple<br>
> languages. Like on a DVD, where you can choose your audio and subtitles<br>
> language. And also imagine there is the possibility of downloading a<br>
> file with the video, along with either the chosen audio/sub tracks, or<br>
> all of them at once. Right now, though, there's no way to deliver<br>
> multiple audio and subtitle streams on HTML5 and WebM. Since the latter<br>
</div><div class="im">> supports only one audio and one video track, with no embedded subtitles,<br>
> creating a file with multiple tracks is impossible, unless using full<br>
> Matroska instead of WebM - save for the fact that the standard proposed<br>
> is WebM and not Matroska.<br>
><br>
> A solution could be to stream the full Matroska with all tracks<br>
> embedded. This, though, would be inefficient, since the user often will<br>
> select only one language to view the video, and there's no way yet to<br>
> stream only the selected tracks to the user. I have thought of two<br>
> solutions for this:<br>
><br>
> * Solution 1: Server-side demuxing. The video with all tracks is stored<br>
> as a Matroska file. The server demuxes the file, generates a new one<br>
> with the chosen tracks, and streams only the tracks chosen by the user.<br>
> When the user chooses to download the full video, the full Matroska file<br>
> is downloaded with no overhead. The downside is the server-side demuxing<br>
> and remuxing; fortunately most users only need to choose once. Also,<br>
> there's the problem of having to download the full file instead of a<br>
> file with only the tracks wanted; this could be solved by even more<br>
> muxing.<br>
<br>
</div><div class="im">On Sun, 23 May 2010, Silvia Pfeiffer wrote:<br>
><br>
> For the last 10 years, we have tried to solve many of the media<br>
> challenges on servers, making servers increasingly intelligent, and by<br>
> that slow, and not real HTTP servers any more. Much of that happened in<br>
> proprietary software, but others tried it with open software, too. For<br>
> example I worked on a project called Annodex which was trying to make<br>
> open media resources available on normal HTTP servers with only a cgi<br>
> script installed that would allow remuxing files for serving time<br>
> segments of the media resources. Or look at any of the open source RTSP<br>
> streaming servers that were created.<br>
><br>
> We have learnt in the last 10 years that the Web is better served with a<br>
> plain HTTP server than with custom media servers and we have started<br>
> putting the intelligence into user agents instead. User agents now know<br>
> how to do byte range requests to retrieve temporal segments of a media<br>
> resource. I believe for certain formats it's even possible to retrieve<br>
> tracks through byte range requests only.<br>
><br>
> In short, the biggest problem with your idea of dynamic muxing on a<br>
> server is that it's very CPU intensive and doesn't lead easily to a<br>
> scalable server. Also, it leads to specialised media servers in contrast<br>
> to just using a simple HTTP server. It's possible, of course, but it's<br>
> complex and not general-purpose.<br>
<br>
</div><div class="im">On Mon, 31 May 2010, Lachlan Hunt wrote:<br>
><br>
> WebM, just like Matroska, certainly does support multiple video and<br>
> audio tracks.  The current limitation is that browser implementations<br>
> don't yet provide an interface or API for track selection.<br>
><br>
</div><div class="im">> Whether or not authors would actually do this depends on their use case<br>
> and what trade offs they're willing to make.  The use cases I'm aware of<br>
> for multiple tracks include offering stereo and surround sound<br>
> alternatives, audio descripitons, audio commentaries or multiple<br>
> languages.<br>
><br>
> The trade off here is in bandwidth usage vs. storage space (or<br>
> processing time if you're doing dynamic server side muxing). Duplicating<br>
> the video track in each file, containing only a single audio track saves<br>
> bandwidth for users while increasing storage space. Storing all audio<br>
> tracks in one multi-track webm file avoids duplication, while increasing<br>
> the bandwidth for users downloading tracks they may not need.<br>
><br>
> The latter theoretically allows for the user to dynamically switch audio<br>
> tracks to, e.g. change language or listen to commentary, without having<br>
> to download a whole new copy of the video.  The former requires the user<br>
> to choose which tracks they want prior to downloading the appropriate<br>
> file.<br>
><br>
> If there's only a choice between 2 or maybe 3 tracks, then the extra<br>
> bandwidth may be insignificant.  If, however, you're offering several<br>
> alternate languages in both stereo and surround sound, with audio<br>
> descriptions and directors commentary — the kind of stuff you'll find<br>
> on many commercial DVDs — then the extra bandwidth wasted by users<br>
> downloading so many tracks they don't need may not be worth it.<br>
<br>
</div><div class="im">On Sat, 22 May 2010, Carlos Andrés Solís wrote:<br>
><br>
> * Solution 2: User-side muxing. Each track (video, audio, subtitles) is<br>
> stored in standalone files. The server streams the tracks chosen by the<br>
> user, and the web browser muxes them back. When the user chooses to<br>
> download the video, the generation of the file can be done either<br>
> server-side or client-side. This can be very dynamic but will force<br>
> content providers to use extra coding inside of the pages.<br>
<br>
</div><div class="im">On Sun, 23 May 2010, Silvia Pfeiffer wrote:<br>
><br>
> Again, we've actually tried this over the last 10 years with SMIL.<br>
> However, synchronising audio and video that comes from multiple<br>
> servers and therefore has different network delays, different<br>
> buffering rates, different congestion times, etc. makes it really<br>
> difficult to keep multiple media resources in sync.<br>
><br>
> You don't actually have to rip audio and video apart to achieve what<br>
> you're trying to do. Different Websites are created for different<br>
> languages, too. So, I would expect that if your Website is in Spanish,<br>
> you will get your video with a Spanish audio track, or when it's in<br>
> German, your audio will be German. Each one of these is a media<br>
> resource with a single audio and a single video track. Yes, your video<br>
> track is replicated on the server between these different resources.<br>
> But that's probably easier to handle from a production point of view<br>
> anyway.<br>
<br>
</div>Silvia's comments pretty much parallel my own understanding of this<br>
situation (maybe because much of my understanding comes from Silvia<br>
educating me on these topics!).<br>
<br>
The long and short of it is that it's probably too early to add more<br>
features along these lines to HTML. As Silvia points out, we haven't even<br>
solved the comparatively simple problem of localising a Web page. It may<br>
be that we don't need to.<br>
<div><div></div><div class="h5"><br>
<br>
On Sun, 23 May 2010, Silvia Pfeiffer wrote:<br>
><br>
> The matter with subtitle / caption tracks is then a separate one. You<br>
> could embed all of the subtitle tracks in all the media resources to<br>
> make sure that when a file is downloaded, it comes with its<br>
> alternative subtitle tracks. That's not actually that huge an<br>
> overhead, seeing as text tracks make up the least space compared to<br>
> the audio and video data.<br>
><br>
> Or alternatively you could have the subtitle tracks as extra files.<br>
> This is probably the preferred mode of operation and most conformant<br>
> with traditional Web principles, seeing as they are text resources and<br>
> the best source of information for indexing the content of a media<br>
> resource in, e.g. a search engine. Also, such files are much easier to<br>
> administrate than if they are inside a media resource - easier to<br>
> produce separately from the media resource and add later - easier to<br>
> edit post-publishing - and easier to provide from e.g. a database<br>
> rather than as an actual file.<br>
><br>
> It is this latter approach that the new HTML5 <track> element is<br>
> pursuing. In this scenario, the Web browser will indeed synchronise<br>
> the text with the media resource for playback. It doesn't need to do<br>
> muxing for this, since it only needs to display the media resource and<br>
> the text in syc, not actually create a new resource. Whether we want<br>
> to take the next step and do an actual muxing on the client for a<br>
> downloaded media resource with multiple <track> elements is a question<br>
> that needs to be discussed. It is indeed a possibility. But it's not<br>
> something I'm worried about, since there are tools available for<br>
> muxing that I can use if I really wanted to create such a file after<br>
> downloading the individual text tracks.<br>
<br>
</div></div>Yeah, people definitely want the ability to have external text timed<br>
tracks.<br>
<br></blockquote><div><br>Three issues I have taken out of this discussion that I think are still open to discuss and potentially define in the spec:<br><br>* How to expose in-band extra audio and video tracks from a multi-track media resource to the Web browser? I am particularly thinking here about the use cases Lachlan mentioned: offering stereo and surround sound alternatives, audio descriptions, audio commentaries or multiple languages, and would like to add sign language tracks to this list. This is important to solve now, since it will allow the use of audio descriptions and sign language, two important accessibility requirements.<br>

<br>* How to associate and expose such extra audio and video tracks that are provided out-of-band to the Web browser? This is probably a next-version issue since it's rather difficult to implement in the browser. It improves on meeting accessibility needs, but it doesn't stand in the way of providing audio descriptions and sign language - just makes it easier to use them.<br>

<br>* Whether to include a multiplexed download functionality in browsers for media resources, where the browser would do the multiplexing of the active media resource with all the active text, audio and video tracks? This could be a context menu functionality, so is probably not so much a need to include in the HTML5 spec, but it's something that browsers can consider to provide. And since muxing isn't quite as difficult a functionality as e.g. decoding video, it could actually be fairly cheap to implement.<br>

<br>Cheers,<br>Silvia.<br><br></div></div>