CSCI 470
Web Science
Spring 2014

Montana Tech
Computer Science & Software Engineering



Streaming Video Player

Due: 10PM, Fri 5/9.
This assignment can be done individually or in pairs.
You may use late days if you have any left.
This assignment is worth 60 points.

You are part of a company building a new streaming video service. Your job is to develop a client application that plays streaming video loaded from your company's web server farm. The player needs to adapt to network conditions, changing its playback rate and quality as necessary to achieve an aesthetically pleasing user experience.

Overview. You need to develop a streaming video player. The exact client technology is up to you, though a Java desktop application is probably the easiest choice. Other possibilities include a web-based version using HTML5, an Android app, or an iIOS app.

Video details. We will do video playback using a simple scheme of flashing a series of JPEG images. Each frame of a video is stored as a separate file on your company's web server farm. The client program should have a way to specify a tracking URL. If you are doing a Java desktop application, this should be sent as the first command-line argument:
% java VideoPlayer http://66.62.125.52/lakes.tracker
The tracking file is a plaintext file that lives on a web server somewhere and specifies the details of a particular video. For example:
Lakes paddling
4845
30.0
640
480
http://66.62.125.52/videos/lakes        http://66.62.125.64/videos/lakes
Here is what each line of the tracker files means:
  1. The human readable name of the video. Your program should display the title somewhere in the player (e.g. as the title of the Java application).
  2. Total frames in this video (a positive integer).
  3. Frames per second that the video should playback at (a positive floating point number).
  4. Width of the video in pixels (a positive integer).
  5. Height of the video in pixels (a positive integer).
  6. Whitespace delimited list of base URLs where the video frames live on the web farm (a positive integer).
I have deployed tracker files and the videos on the two servers 66.62.125.52 and 66.62.125.64. The following tracker files are available in the root directory of both web servers: Both servers have a videos subdirectory containing separate directories for each of the different videos. You can browse the directory structure at http://66.62.125.52/videos/lakes/

As you can see, each video has a subdirectory qXX where XX is one of 8 different JPEG quality settings: 10, 20, ..., 80. The higher the quality level, the bigger the frame size is. In each quality level subdirectory, all the video frames are stored using a filename consisting of the 1-based frame number padded to 8 digits, e.g. 00000001.jpg, 00000002.jpg, etc.

Your player should spread retrieval approximately equally between all servers in listed in the tracker file. For the purposes of this assignment, you can assume all servers are online and operational (i.e. the server farm exists for scalability, but not for high availability).

Playback details. You are allowed an initial small (3 seconds or less) buffering period before playback starts. After the playback commences, you must continue at the video's recorded FPS regardless of network conditions. You are NOT allowed to pause playback to do any further buffering. You may not be able to display every single frame in the source video. You may also need to reduce the quality of the image frames delivered to the player if the network or client can't cope.

The exact policies you implement is up to you, but you will need to justify your choices in the report for the project. Your player should adapt intelligently degrading or improving playback quality as conditions warrant. Your player should look aesthetically pleasing as possible given the network realities (e.g. you shouldn't flash blank white or black frames).

Interface details. Your interface needs to display the following details: My player also has a visualization of the playback location, the loaded frames (top, purple), the quality of loaded frames (middle, grey), the present location of frame retrieval threads (green lines), the player's requested FPS (bottom, yellow line), and the location of a thread that prepares image buffers (blue line). This is completely optional. Though I found the visualization was very helpful in debugging and tuning my player. You could also use System.out.println debug messages.

Player configuration. Deliverables. Along with your source code, you should also need to complete this report, answering the questions and providing benchmark results.

Example videos. Here are links to videos I recorded of my solution using different videos, number of retrieval threads, and network conditions:

Submission. Submit your source code and report to the Moodle dropbox. The Moodle timestamp is the completion time for the assignment.

Page last updated: December 30, 2014