Flash Video (FLV) : delivery and encoding

Last update : Januray 30, 2013

Due to the popularity of the Adobe Flash player, Flash video (FLV) was the standard of choice for Internet Video publishers in the past. Publishers could choose between three methods of delivering video content.

  • Progressive Download
  • Streaming
  • HTTP pseudo-streaming

Downloads are easy and work with any server, but do not offer content protection nor seeking to undownloaded parts. Streaming servers offer these functionalities, but have to be installed and managed. Since serverside access and knowledge are not available to every developer, there exist an in-between solution of HTTP pseudo-streaming through the use of small serverside scripts. A detailed tutorial about HTTP video streaming has been written by Jeroen Wijering, the renowned developer of the JW player and cofounder of LongTail Video and Bits on the Run.

The streaming protocol for Flash video is RMTP (Real Time Messaging Protocol). RTMP is a proprietary persistant protocol developed by Adobe Systems for streaming audio, video and data over the Internet, between a Flash player and a server.

The RTMP protocol has three variations:

1. The “plain” protocol which works on top of TCP and uses port number 1935
2. RTMPT which is encapsulated within HTTP requests to traverse firewalls
3. RTMPS which works just like RTMPT, but over a secure HTTPS connection.

The HTTP pseudo-streaming works through a very simple mechanism. It’s a progressive download using server side scripting to allow random access to parts of the video that have not yet been loaded. A well known php script for HTTP pseudo-streaming was xmoov, developed by Eric Lorenzo Benjamin jr. The FLV video must contain keyframes metadata which can be added with a patcher like FLVMDI.

The second issue for delivering flash video on the web is the encoding. An in-depth comparison of available codecs is presented by Jan Ozer in an article published on the website digitalcontentproducer.com.

Flash video uses three different codecs:

  • The Sorenson Spark codec, introduced in Flash version 7, (Sorenson H.263) was used a lot (e.g. at YouTube, Google Video, MySpace). This codec was also found in most freeware / shareware software that encodes FLV.
  • The TrueMotion VP6 codec developed by On2 Technologies was introduced in Flash version 8. It was a famous proprietary codec used in the Flix encoding tools offered by On2. Two versions of the VP6 were available: VP6-S was recommended for HD (high-definition) production, and VP6-E was the best for SD (standard definition) production.
  • The industry-standard H.264 video codec is icluded in Flash since version 9r115. This codec is also known as MPEG-4 Part 10, or MPEG-4 AVC (for Advanced Video Coding). With H.264, DVD-quality online video is very well possible. An advantage of the H.264 codec is that it is also used in a lot of portable devices, such as the iPod/iPhone, Sony PlayStation Portable (PSP) or Nokia N series smartphones.

A comparison of the quality of H.263 and 264 codecs is presented by Jeroen Wijering on the Bits on the Run website.

I use the commercial version of Jeroen Wijerings video-player (licence No 2007.3264). My video files are hosted on the Amazon S3 servers, the preview pictures are hosted in the same folder as the video player on another server by using a relative path for the corresponding flashvariable. Since 2010 I use the Amazon Cloudfront service to stream flash videos.