# Video Delivery & Compression Notes

## Delivery Method (User-Corrected 2026-05-29)
The combined HTML page with `<video>` tags **DOES NOT WORK** on mobile QQ browser.
The ONLY method that works: **individual MP4 links only**.
- Format: `http://74.48.56.81/download/filename.mp4`
- Send links as plain text with emoji + short description
- Do NOT create combined HTML index pages — user can't play them on mobile
- User confirmed: 3 separate links work, combined page doesn't play

## Compression Settings (Mobile-Optimized)
```bash
ffmpeg -i input.webm -t 20 -c:v libx264 -profile:v baseline -level 3.0 -preset ultrafast -crf 30 -c:a aac -b:a 64k -movflags +faststart -vf "scale=480:-2" output.mp4 -y
```
- `scale=480:-2` — 480px width, auto height
- `-profile:v baseline -level 3.0` — max device compatibility
- `-preset ultrafast` — encoding speed > quality for short clips
- `-crf 30` — small file, acceptable for funny clips
- `-t 20` — truncate to 20s highlights
- Target: 1-5 MB per clip

## Watermark: Now Acceptable (User Decision 2026-05-29)
- User said: "有水印就是有水印嘛，先搞过来再说"
- YouTube watermarks OK for 视频号/抖音 posting
- Crop option: `-vf "crop=iw-200:ih:100:0"` (loses frame area)
- Prioritize funniness over watermark-free perfection

## ItemFix Reality
- Videos dynamically loaded, individual pages return 404
- Cannot reliably extract direct MP4 URLs
- Better to use YouTube downloads (accepting watermark) than wasting hours on ItemFix extraction

## Nginx Serving
- Port 80 open only (UFW: 80/443/22)
- `/download/` alias → `/var/www/downloads/`
- ffmpeg is SLOW — use ultrafast + crf 30 + truncate
- Copy: `cp /root/Downloads/*.mp4 /var/www/downloads/`
