Skip to content

Instantly share code, notes, and snippets.

@smason
Last active March 17, 2025 22:24
Show Gist options
  • Save smason/1830565e4f88831abd9d050ea01e4b3b to your computer and use it in GitHub Desktop.
Save smason/1830565e4f88831abd9d050ea01e4b3b to your computer and use it in GitHub Desktop.

AlphaPhoenix

https://www.youtube.com/watch?v=YMO9uUsjXaI

input data:

  • 140 teeth around the wheel
  • total distance = 3.86 miles
  • original frame size = 367x367

Inferred speed in the video: mean = 298 Mm/s, 95% CI = [285, 310]

processing

# download part of video
yt-dlp \
  -f 248 -o "AlphaPhoenix-speedoflight-res.%(ext)s" \
  --download-sections "*15:30-15:33" \
  https://www.youtube.com/watch?v=YMO9uUsjXaI

yt-dlp \
  -f 248 -o "AlphaPhoenix-speedoflight-full.%(ext)s" \
  --download-sections "*12:37-12:42" \
  https://www.youtube.com/watch?v=YMO9uUsjXaI

# grab cropped and resized frames
ffmpeg -i AlphaPhoenix-speedoflight-res.webm \
  -vf "crop=958:958:926:46,scale=367:367" \
  -ss 0.6 "frames/res_%03d.png"

ffmpeg -ss 2 -t 3.1 \
  -i AlphaPhoenix-speedoflight-full.webm \
  -vf "crop=1080:1080,scale=360:360:flags=neighbor" \
  "frames/full_%03d.png"

The individual photos appear a couple of times; the first set I noticed started around 15:30 and includes info that they were 367 pixels square. I then noticed full screen versions appearing at 12:37. They are presumably both the same just resampled differently, as they are both stabilised the same.

data {
int<lower=0> N; // number of frames
int<lower=0> K; // number of pixels
vector[K] angle; // angle of each pixel (in degrees)
vector[K] dist; // distance of each pixel away from circle
vector[N] rpm;
array[N] vector[K] pixels; // brightness of each pixel for each frame
}
parameters {
real<lower=-40, upper=-35> alpha; // start angle
array[N, 3] real<lower=0> mass;
real<lower=0> scale;
real<lower=0> sigma;
real beta; // baseline brightness
real<lower=0> rpm_mul;
}
model {
for (n in 1:N) {
vector[K] mu = rep_vector(beta, K);
real off = alpha + rpm[n]*rpm_mul;
for (m in 1:3) {
mu += mass[n,m] * exp(-scale*square(angle - (off + (m-2) * (360. / 140.))));
}
pixels[n] ~ normal(mu, sigma);
mass[n] ~ normal(0.1, 0.02);
}
rpm_mul ~ normal(1e-5, 1e-5);
alpha ~ normal(-40, 1);
scale ~ normal(1, 1);
sigma ~ normal(0, 1);
beta ~ normal(0.2, 0.1);
}
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment