Over a million developers have joined DZone.

Using HTTP to stream video

DZone's Guide to

Using HTTP to stream video

· Web Dev Zone ·
Free Resource

Learn how to add document editing and viewing to your web app on .Net (C#), Node.JS, Java, PHP, Ruby, etc.

Showing complete videos on the web more or less works if you use HTML5 and the H264 format. For browsers that cannot handle this combination, you should offer a fall back to Flash. Theora is also worth looking at, because many (non-Apple) browsers support it. The streaming story is more complicated. The current solution is to use the Real Time Streaming Protocol (RTSP). But it has two disadvantages:

  • Special server and infrastructure are needed
  • Difficulty with firewalls

Apple has proposed a standard to solve these issues:

  • Split a video into a set of small clips (of, say, 10 seconds), link them via an index file. The index file can be appended to if the stream grows, as is the case for live streams.
  • The stream can be adapted to the needs of the client. For example, a cell phone might migrate from Wi-Fi to a cell phone network. Then the stream should have a lower resolution. This is enabled by storing the clips in different versions.
  • Encryption is supported and content providers can prohibit local caching at the client.

Pros and cons:

  • Pro: Any HTTP server can be used for streaming, no special server software needed. Just preprocess your video with Apple’s tool to produce the required files. If you want a live stream, things obviously become more complicated.
  • Pro: HTTP is proven technology that works with any firewall.
  • Con: Client-side support is currently limited to QuickTime on Mac OS X Leopard and iOS. No Windows or Linux! The last two of Apple’s keynotes were transmitted via HTTP streaming and the quality was superb. This explains the requirements for watching them.

[Source: Ars Technica]

Extend your web service functionality with docx, xlsx and pptx editing. Check out ONLYOFFICE document editors for integration.


Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}