# Highway Video

The low-rank approximation demo uses real footage of the A40 motorway in Dortmund, Germany, filmed from a bridge.

- **Creator:** Kathinka Engels / Sounds of Changes.
- **Source:** [Motorway A40: on a bridge above the traffic](https://commons.wikimedia.org/wiki/File:Motorway_A40_-_on_bridge_above_the_traffic.webm), uploaded December 14, 2018.
- **Original file:** [WebM video](https://upload.wikimedia.org/wikipedia/commons/7/75/Motorway_A40_-_on_bridge_above_the_traffic.webm), 1280 × 720 pixels, 24.574 seconds, 9,365,279 bytes.
- **License:** [Creative Commons Attribution 3.0 Unported](https://creativecommons.org/licenses/by/3.0/), as specified in the file's licensing section.
- **Original SHA-256:** `f4c7c1d826a166b78353386ecdc10ed2090255eaca832c083a64f8ea633257dc`.

We sampled 96 frames at four frames per second, starting at 0.125 seconds and ending at 23.875 seconds.
Chromium resized each frame to 256 × 144 pixels, and Pillow converted it to grayscale using `Image.convert("L")`.
The audio is omitted.
The notebook further transforms these frames with a rank-one SVD and displays their residuals.

`highway_frames.npz` contains `frames` (96 × 144 × 256 unsigned 8-bit intensities), `times` (seconds in the source), and `fps` (4).
Its SHA-256 is `ef5aa0ca2ed2f8732bfa681e3521f0de0dbfb0d8ee68662b4610f7cfea2fe181`.
Keeping this small frame archive with the course makes the notebook usable without a video decoder or a request to the source host.

To regenerate it, download the original WebM to the project's bulk-data directory, then run the preparation script through the course's compute wrapper:

```bash
tools/run_compute.sh highway-frames python3 topics/15_low_rank_approximation/prepare_highway_video.py /path/to/motorway_a40.webm
```

The preparation script verifies the original file's checksum before decoding it.
It requires NumPy, Pillow, and Playwright with Chromium installed.
