Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions suites-experimental/media-performance/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Media Asset Attributions

## bigbuckbunny-video.webm and bigbuckbunny-audio.webm

Excerpt from "Big Buck Bunny" (https://peach.blender.org/), © 2008 Blender
Foundation. Licensed under the Creative Commons Attribution 3.0 Unported
License (https://creativecommons.org/licenses/by/3.0/).

The assets are bundled here solely as deterministic input for the
Media-Streaming workload. The original source file (`bbb_sunflower_1080p_60fps_normal.mp4.zip`) was obtained from the official [Blender Foundation repository](https://peach.blender.org/download/). It was re-encoded using FFmpeg 8.1.2 (specifically Lavc 62.28.102 / Lavf 62.12.102) into separate single-track WebM representations (VP9 video and Opus audio, DASH streaming architecture):

```bash
# Pass 1: VP9 Video Stream
ffmpeg -y -i bbb_sunflower_1080p_60fps_normal.mp4 -c:v libvpx-vp9 \
-b:v 4M -minrate 1.5M -maxrate 8.8M -crf 31 \
-g 300 -keyint_min 0 \
-tile-columns 2 -threads 8 -speed 4 \
-auto-alt-ref 1 -arnr_max_frames 7 -arnr_strength 5 -arnr_type 3 \
-rc_lookahead 24 -enable-tpl 1 \
-pass 1 -an -f null /dev/null

# Pass 2: VP9 Video Stream
ffmpeg -y -i bbb_sunflower_1080p_60fps_normal.mp4 -c:v libvpx-vp9 \
-b:v 4M -minrate 1.5M -maxrate 8.8M -crf 31 \
-g 300 -keyint_min 0 \
-tile-columns 2 -threads 8 -speed 2 \
-auto-alt-ref 1 -arnr_max_frames 7 -arnr_strength 5 -arnr_type 3 \
-rc_lookahead 24 -enable-tpl 1 \
-pass 2 -an \
bigbuckbunny-video.webm

# Extract Opus Audio Stream
ffmpeg -y -i bbb_sunflower_1080p_60fps_normal.mp4 -vn \
-c:a libopus -b:a 128k -ac 2 \
bigbuckbunny-audio.webm
```

This delivers a 2-pass VP9 video stream (1080p, 60fps) with alternate reference frames (`-auto-alt-ref 1`), a 5-second keyframe interval (`-g 300`), and ~4 Mbps bitrate for decoder stress testing, paired with a separate Opus audio stream (stereo, 128k) in dedicated WebM containers.
35 changes: 35 additions & 0 deletions suites-experimental/media-performance/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Media Performance Workloads

This benchmark suite measures the performance, responsiveness, and processing throughput of modern web media APIs.

---

## 1. Media-Streaming (`streaming.html` / `streaming.js`)

### InitialPlayback

Tests standard video playback initialization latency via Media Source Extensions (MSE) to simulate typical streaming user journeys on platforms like YouTube or Vimeo. The time measured is from the `play` button clicked to the first video frame painted on the screen. We use `requestVideoFrameCallback` to ensure that the video is painted on the screen.

### Seek

Measures the latency of performing a quick skip-ahead action within an already loaded media stream. This simulates a common user interaction, such as scrubbing through a video timeline or double-tapping right to skip forward on a streaming platform. The time measured is from the `seek` button clicked to the first video frame painted on the screen after seeking. We use `requestVideoFrameCallback` to ensure that the video is painted on the screen after seeking.

---

## 2. Media-Conferencing (`conferencing.html` / `conferencing.js`)

### VideoChat

Tests real-time video encoding and decoding pipelines using WebCodecs. While the UI simulates a Video Chat call, WebRTC is not tested; the focus is purely on measuring VideoEncoder and VideoDecoder throughput. The time measured is from the `video-benchmark` button clicked until all video frames have been encoded, decoded, and the session is torn down.

### VoiceChat

Tests real-time audio encoding, decoding using WebCodecs and audio routing and effects processing using WebAudio. It measures the browser's efficiency in processing audio streams and applying standard audio nodes. The two stages run sequentially in a simulated media pipeline: audio routing and effects processing complete via WebAudio, and the resulting rendered audio buffer is directly encoded and decoded via WebCodecs. The time measured is from the `voice-benchmark` button clicked until all audio frames have been encoded/decoded and the WebAudio offline rendering completes.

---

## Notes & Troubleshooting

### Safari & Low Power Mode

When running these workloads in Safari on macOS or iOS, verify that **Low Power Mode** is disabled. Low Power Mode completely restricts programmatic media playback (`video.play()` and automated media pipelines) regardless of muted state, which will cause tests to fail with a `NotAllowedError`.
Binary file not shown.
Binary file not shown.
30 changes: 30 additions & 0 deletions suites-experimental/media-performance/conferencing.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Media Conferencing Workload</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="controls">
<button id="video-benchmark">Video Chat</button>
<button id="voice-benchmark">Voice Chat</button>
</div>
<div class="stage">
<div class="canvas-grid">
<div class="canvas-cell">
<h4>Local Preview</h4>
<canvas id="local-canvas" width="1920" height="1080"></canvas>
</div>
<div class="canvas-cell">
<h4>Remote Preview</h4>
<canvas id="remote-canvas" width="1920" height="1080"></canvas>
</div>
</div>
<div class="status">
<span id="status">Idle</span>
</div>
</div>
<script src="conferencing.js"></script>
</body>
</html>
Loading