Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DASH Measurement Pipeline

Measurement pipeline for running ABR (Adaptive Bitrate) streaming tests between mobile devices and remote video servers.

Overview

This project provides scripts and tools for conducting adaptive bitrate streaming experiments.

Video Server

  • DASH encoded videos, ffmpeg, mp4box
  • dashjs over HTTP server (Caddy)
  • tcpdump, ss scripts

Android Device (video client)

  • Python script that loads DASH video
  • Log DASH metrics
  • (if rooted) tcpdump script

Installation

Server Setup

Navigate to server directory. The server serves the video_server/index.html

Prepare Video Content

Encode one max quality video to multiple quality representations, then convert to dash chunks:

python convert_dash.py ~/bbb_sunflower_native_60fps_normal.mp4 -o chunks -p bbb_sunflower -m manifest.mpd

By default, encoded chunks and manifest are video_server/chunks.

Install server & dash

  • Install Caddy and lsquic.
  • Get a dashjs and put into video_server/js (included ESM debug version 5.0.0)

Client Setup

Setup Termux in Android.

  • Install Termux. Then inside a termux terminal,
# Allow Termux to access download folder, then restart Termux
termux-setup-storage
# Update package manager
pkg update && pkg upgrade
# Install Python and dependencies
pkg install python python-numpy
# Install Selenium for web automation
pip install selenium
# Install Git and clone repository
pkg install git
git clone {THIS_REPO}
# (Optional) Install tcpdump for network capture
pkg install root-repo tcpdump

For Chromium, we use a known-good build from tur-repo. The latest version enforces restriction on single-process mode and won't work.

# Install required repositories
pkg install x11-repo tur-repo
pkg update
# Install known-good Chromium build from tur:
pkg install "chromium=133.0.6943.141"
# Prevent upgrades to newer Chromium builds
apt-mark hold chromium
# Verify installed Chromium/ChromeDriver versions
chromium-browser --version
chromedriver --version
  • (Optional) test
# Test browser functionality
# This opens a website and saves a page screenshot to `./screenshot.png`
python client_browser_func_test.py

# Test browser https functionality
# (Note: Start the Caddy server first!)
# Check Caddy server logs for https requests
python client_browser_https_test.py {SERVER_IP}

Run

Server

Start Video Server

The Caddy server serves two ports, HTTP at 5203 and HTTPS default.

# Start Caddy server
caddy run --config ./Caddyfile

HTTPS Note: We use self-signed tls and it would not work unless the client explicitly trusts it (our script handles that). We need HTTPS to enforce HTTP2, which uses TCP connection multiplexing.

Start Network Monitoring

# Create captures directory
mkdir -p ./captures

# Start network monitoring
sudo ./monitor.sh 5202 test0

Client

  • Connect to logger tool
  • Start video streaming. Inside termux,
python client_run_dash.py -s={SERVER_IP} -i={LOG_ID}

To run multiple experiments in sequence, use -r=N where N is the total number of runs (-r=1 is equivalent to a single run):

python client_run_dash.py -s={SERVER_IP} -i={LOG_ID} -r=3

The scripts collect log events exposed by dash player into captures/*.json.

Post-processing

TODO Calculate QoE metrics.

  • Timestamp: Unix timestamp (seconds since epoch)
  • Bitrate: Selected bitrate (Kbps) for the video chunk
  • Buffer Size: Playback buffer size after downloading the chunk
  • Rebuffer Time: Time spent rebuffering (playback stalled) for this chunk
  • Chunk Size: Size (bytes) of the downloaded video chunk
  • Download Time: Time (ms) to download the video chunk

Time Synchronization

Manual NTP Offset Extraction

Currently, we manually extract the timing offset between the mobile device and the same ntp server that the server is using. The assumption is that clock don't drift too much between during experiment. Usually the differnce between the offset to ntp server is >20ms.

Video Server

# Check if video server is using ntp server (e.g., systemd-timesyncd)
sudo systemctl status systemd-timesyncd.service
# Query offset (e.g., 2.time.constant.com)
ntpdate -q 2.time.constant.com

Client

In termux, install chrony and configure it to use the same ntp server as the video server. Then manually check the offset.

# Install chrony
pkg install chrony
# Configure chrony
mkdir -p ~/.config/chrony
vim ~/.config/chrony/chrony.conf
# Add the following lines
server 2.time.constant.com iburst
makestep 0.1 3

# Manually check offset
chronyd -f ~/.config/chrony/chrony.conf -d -Q

Automatic Time Synchronization

TODO: add a script to automatically sync time and extract offset.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages