Providing the Demo Video¶
The public page /video plays the LLARS demo video. There are two versions: the
original /videos/llars_demo.mp4 (about 88 MB, 3600×2260) and the mobile
version /videos/llars_demo_1080p.mp4 (about 24 MB, 1720×1080) for phones (see
Mobile version). Both are deliberately kept out of the
repository and out of the frontend image (git- and dockerignored). nginx serves
them straight from a directory on the host. On a new host, and whenever one of
the two addresses returns 404, they have to be placed there once by hand.
How to recognise the problem
/video shows the notice "The video can't be loaded right now" with the
YouTube backup, curl -I …/videos/llars_demo.mp4 returns 404 Not Found
(nginx error page, text/html, 146 bytes), and the smoke test reports
WARNING: Demo-Video fehlt auf dem Host. If only the mobile version is
missing, it reports WARNING: Mobile Demo-Video-Fassung fehlt; desktops
still play the video, while an iPhone shows the notice once play is tapped.
The notice only appears on a real error (file missing or not playable). If neither metadata nor an error arrives within 8 seconds, the player stays visible and a soft hint with the YouTube link appears below it. On an iPhone that is the normal case, because Safari does not preload anything until play is tapped (since T-33, 7 October 2026).
Where the file lives¶
| What | Value |
|---|---|
| Host path (default) | /var/llars-static/videos/llars_demo.mp4 |
| Mobile version | /var/llars-static/videos/llars_demo_1080p.mp4 |
| Variable | LLARS_STATIC_DIR in /var/llars/.env (default /var/llars-static) |
| Path inside the nginx container | /srv/llars-static/videos/ (read-only) |
| Mount | docker-compose.prod.yml (production) and docker-compose.staging.yml (staging :55080) |
| nginx | location /videos/ in nginx.prod.conf (port 80 and 443) and nginx.prod-no-ssl.conf |
| Source | llars-frontend/public/videos/llars_demo.mp4 on a developer machine; the mobile version is made from it with ffmpeg |
Poster image (poster) |
llars-frontend/src/assets/video/llars_demo_poster.jpg in the repository (see below) |
Why outside the checkout¶
Until 2 October 2026 docker-compose.prod.yml mounted the video from
./static/videos, i.e. /var/llars/static/videos inside the checkout. Every
deploy cleans the checkout with git reset --hard and git clean -fd, and
git clean removes everything untracked that is not ignored. Because
deploy_bluegreen.sh rewrites the tracked docker/nginx/active_upstream.conf on
every deploy, the cleanup ran practically every time. On production the
directory was therefore empty, stamped with the time of the nightly deploy
(02:22).
The default now lives under /var/llars-static, out of reach of any
git clean (even with -x) and of a fresh checkout. /static/ is also listed
in .gitignore, and the scripts exclude static/ from git clean, so the old
path is no longer emptied either.
Blue-green¶
Blue and green share one checkout under /var/llars; the colours only differ
in container names and compose projects. The nginx container
(llars_nginx_service) belongs to neither colour. So there is exactly one video
directory, and switching colours does not change it.
Placing the file¶
/var/llars-static sits under /var and needs root rights the first time it is
created. Without sudo this works through a short-lived container, the same way
deploy_bluegreen.sh runs its chown (Docker creates the missing host
directory for -v itself). From a developer machine (SSH alias llars for
production, llars-dev for kia-dev; both need the VPN):
scp llars-frontend/public/videos/llars_demo.mp4 llars:/tmp/llars_demo.mp4
ssh llars 'docker run --rm \
-v /tmp/llars_demo.mp4:/src/llars_demo.mp4:ro \
-v /var/llars-static:/dst \
alpine:3.19 sh -c "mkdir -p /dst/videos \
&& cp /src/llars_demo.mp4 /dst/videos/llars_demo.mp4 \
&& chmod 755 /dst /dst/videos && chmod 644 /dst/videos/llars_demo.mp4" \
&& rm -f /tmp/llars_demo.mp4'
With sudo on the host it works directly:
sudo install -D -m 0644 /tmp/llars_demo.mp4 /var/llars-static/videos/llars_demo.mp4
sudo chmod 755 /var/llars-static /var/llars-static/videos
Permissions matter: the nginx worker runs as user nginx inside the container
and needs read access to the file (644) and the directories (755).
Once, after the switch of 2 October 2026
If the video was previously placed in /var/llars/static/videos/, it has to
be placed in /var/llars-static/videos/ once. Ideally do this before
the deploy that brings the switch, so there is no gap. After the deploy,
check that nginx mounts the new path:
docker inspect llars_nginx_service \
--format '{{range .Mounts}}{{.Source}} -> {{.Destination}}{{"\n"}}{{end}}' | grep videos
If it still shows /var/llars/static/videos, recreate the nginx container
(command below). The old copy under /var/llars/static/ can go afterwards.
Optional: faster start in the browser
In the current file the moov box (metadata) sits at the end. Browsers
fetch it with a range request, which works but takes time on slow
connections. ffmpeg -i llars_demo.mp4 -c copy -movflags +faststart llars_demo_fast.mp4
moves the metadata to the front without re-encoding.
Mobile version¶
The original is encoded as H.264 High Profile Level 6.2 at 3600×2260 pixels,
and its moov box sits at the end. It did not play on an iPhone (ticket T-33):
Level 6.2 is beyond what phones reliably support for H.264, and Safari does not
preload anything there until play is tapped. Until 7 October 2026 phones were
therefore left with the error notice. The mobile version is 1720×1080, encoded
as High Profile Level 4.1, with its metadata at the front (+faststart). It
plays on iPhone and Android.
How the page chooses. DemoVideoPage.vue lists both files as <source>.
The mobile version comes first when the device is a phone
(useMobile().isMobile) or when the browser does not answer
canPlayType('video/mp4; codecs="avc1.64003E"') with probably; otherwise the
original comes first. If the preferred file is missing (404), the browser falls
back to the other one by itself. A missing llars_demo_1080p.mp4 therefore does
not break desktops; on a phone the browser then tries the original, and the old
error stays.
Creating it¶
On a developer machine with ffmpeg (Homebrew) this takes about two minutes on
an Apple-silicon Mac and produces roughly 24 MB:
cd llars-frontend/public/videos
ffmpeg -i llars_demo.mp4 \
-vf "scale=-2:1080" \
-c:v libx264 -profile:v high -level 4.1 -pix_fmt yuv420p -preset slow -crf 23 \
-movflags +faststart \
-c:a aac -b:a 128k \
llars_demo_1080p.mp4
Why scale=-2:1080 and not scale=1920:-2
At 1920 pixels wide the picture becomes 1920×1206. That is 120×76 = 9120
macroblocks, but Level 4.1 allows at most 8192. x264 then warns
frame MB size (120x76) > level limit (8192), still writes "Level 4.1" into
the file, and a strict decoder may reject it. At 1080 pixels high
(1720×1080, 7344 macroblocks) the file stays within the level.
Check before uploading:
# Expected: profile=High, width=1720, height=1080, level=41
ffprobe -v error -select_streams v:0 \
-show_entries stream=profile,level,width,height -of default=nw=1 llars_demo_1080p.mp4
# Expected: type:'moov' first, then type:'mdat' (metadata at the front)
ffprobe -v trace -i llars_demo_1080p.mp4 2>&1 | grep -o "type:'\(moov\|mdat\)'" | head -2
Placing it¶
Same as the original, with the other file name:
scp llars-frontend/public/videos/llars_demo_1080p.mp4 llars:/tmp/llars_demo_1080p.mp4
ssh llars 'docker run --rm \
-v /tmp/llars_demo_1080p.mp4:/src/llars_demo_1080p.mp4:ro \
-v /var/llars-static:/dst \
alpine:3.19 sh -c "mkdir -p /dst/videos \
&& cp /src/llars_demo_1080p.mp4 /dst/videos/llars_demo_1080p.mp4 \
&& chmod 755 /dst /dst/videos && chmod 644 /dst/videos/llars_demo_1080p.mp4" \
&& rm -f /tmp/llars_demo_1080p.mp4'
For kia-dev use the SSH alias llars-dev. No restart is needed: nginx serves any
file that is in the mounted directory.
Poster image¶
The poster image shown in the player before playback lives in the
repository at llars-frontend/src/assets/video/llars_demo_poster.jpg and is
bundled by Vite like any other image. It ships with every deploy and does not
need to be placed by hand. It must not live under /videos/: nginx maps that
address to the host directory, where the image would not exist.
The image is a crop of second 31.5 of the video (title and overview diagram), 1280×804 pixels, about 60 KB. The crop deliberately leaves out the part with the reviewer account credentials:
ffmpeg -ss 31.5 -i llars_demo.mp4 -frames:v 1 \
-vf "crop=2800:1400:400:250,scale=1280:-2,pad=1280:804:(ow-iw)/2:(oh-ih)/2:color=0x222222" \
-map_metadata -1 -q:v 4 llars_demo_poster.jpg
Checking¶
# On the host (emulates the FH gateway, which forwards over HTTP to port 80)
curl -sI -H "X-Forwarded-Proto: https" http://localhost/videos/llars_demo.mp4
# From outside
curl -sI https://llars.e-beratungsinstitut.de/videos/llars_demo.mp4
# Range streaming (seeking, Safari/iOS): expects 206 Partial Content
curl -s -o /dev/null -r 0-0 -w '%{http_code} %{content_type}\n' \
https://llars.e-beratungsinstitut.de/videos/llars_demo.mp4
# Mobile version, same expectation
curl -s -o /dev/null -r 0-0 -w '%{http_code} %{content_type}\n' \
https://llars.e-beratungsinstitut.de/videos/llars_demo_1080p.mp4
Expected: 200 OK (or 206 for the range request), Content-Type: video/mp4
and Accept-Ranges: bytes.
The same check runs in every smoke test (scripts/ci/smoke_test_demo_video.sh,
called from smoke_test.sh). If the file is missing it prints a warning with
the target path and keeps the job green, because a rollback would not bring the
file back. SMOKE_STRICT_VIDEO=1 turns it into a hard failure. It then checks
the mobile version the same way, but only ever as a warning;
SMOKE_STRICT_VIDEO_MOBILE=1 makes that one hard as well:
SMOKE_STRICT_VIDEO=1 BASE_URL=http://localhost bash scripts/ci/smoke_test_demo_video.sh
SMOKE_STRICT_VIDEO=1 SMOKE_STRICT_VIDEO_MOBILE=1 BASE_URL=http://localhost bash scripts/ci/smoke_test_demo_video.sh
The file is on the host, but nginx still returns 404¶
There are two possible causes. Either the running container still mounts the old path (see the box above), or the directory was deleted while nginx was running, so the bind mount still points to the deleted directory. Either way the container does not see the file:
If it is missing there, recreate the nginx container with the same command
deploy_bluegreen.sh uses (it mounts the current active_upstream.conf, so the
active colour stays):
cd /var/llars
docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d --no-deps --force-recreate nginx-service
Staging (:55080) picks up the mount with the next deploy_bluegreen.sh deploy.
Replacing the file¶
Put a new version in place under the same name. nginx serves the video with
expires 7d; browsers that have already loaded it may show the old version from
their cache for up to seven days. When replacing the original, recreate the
mobile version (recipe above) and place both; if the opening changes, make a new
poster image as well.