fix(web-test): update ffmpeg download links and clarify prerequisites

Use direct gyan.dev URL instead of generic ffmpeg.org. Rewrite recording.md
prerequisites as clear alternatives (project / global / config).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-02-28 21:04:31 +03:00
co-authored by Claude Opus 4.6
parent 43a2691d6a
commit 751a6a8f12
2 changed files with 29 additions and 21 deletions
+28 -20
View File
@@ -4,38 +4,46 @@ Record browser automation sessions as MP4 video files. Uses CDP `Page.startScree
## Prerequisites ## Prerequisites
**ffmpeg** must be installed. The binary is resolved in this order: **ffmpeg** must be installed. Choose один из вариантов:
1. `opts.ffmpegPath` parameter in `startRecording()` ### Вариант 1: в проект (рекомендуется)
2. `FFMPEG_PATH` environment variable
3. `ffmpeg` in system PATH
4. `tools/ffmpeg/bin/ffmpeg.exe` relative to project root
### Install ffmpeg on Windows Скачать essentials build с https://www.gyan.dev/ffmpeg/builds/, распаковать в `tools/ffmpeg/` проекта:
Download from https://ffmpeg.org/download.html (Windows builds by gyan.dev or BtbN). ```
Extract and either: tools/ffmpeg/
- Add `bin/` to system PATH ├── bin/
- Set environment variable: `$env:FFMPEG_PATH = "C:\tools\ffmpeg\bin\ffmpeg.exe"` │ ├── ffmpeg.exe ← этот файл ищет startRecording()
- Place in project: `tools/ffmpeg/bin/ffmpeg.exe` │ ├── ffplay.exe
│ └── ffprobe.exe
└── ...
```
### Shared path via .v8-project.json Код автоматически найдёт `tools/ffmpeg/bin/ffmpeg.exe` — ничего больше настраивать не нужно.
To avoid installing per-project, add `ffmpegPath` to `.v8-project.json`: ### Вариант 2: глобально (один раз на машину)
Скачать, распаковать в любой каталог (напр. `C:\tools\ffmpeg`), добавить `bin/` в системный PATH.
После этого ffmpeg доступен во всех проектах.
### Вариант 3: через .v8-project.json (общий путь)
Чтобы не копировать ffmpeg в каждый проект, указать путь в конфиге:
```json ```json
{ {
"v8path": "...", "ffmpegPath": "C:\\tools\\ffmpeg\\bin\\ffmpeg.exe"
"ffmpegPath": "C:\\tools\\ffmpeg\\bin\\ffmpeg.exe",
"databases": [...]
} }
``` ```
When calling `startRecording()`, read this field and pass it: Модель прочитает это поле и передаст в `startRecording({ ffmpegPath })`.
```js ### Порядок поиска ffmpeg
await startRecording('output.mp4', { ffmpegPath: 'C:\\tools\\ffmpeg\\bin\\ffmpeg.exe' });
``` 1. `opts.ffmpegPath` — явный путь (из `.v8-project.json` или параметра)
2. `FFMPEG_PATH` — переменная окружения
3. `ffmpeg` — в системном PATH
4. `tools/ffmpeg/bin/ffmpeg.exe` — относительно корня проекта
## API ## API
+1 -1
View File
@@ -2562,7 +2562,7 @@ function resolveFfmpeg(explicit) {
// 5. Error with instructions // 5. Error with instructions
throw new Error( throw new Error(
'ffmpeg not found. Install it:\n' + 'ffmpeg not found. Install it:\n' +
' - Download from https://ffmpeg.org/download.html\n' + ' - Download from https://www.gyan.dev/ffmpeg/builds/ (essentials build)\n' +
' - Add to PATH, or set FFMPEG_PATH env var, or place in tools/ffmpeg/bin/\n' + ' - Add to PATH, or set FFMPEG_PATH env var, or place in tools/ffmpeg/bin/\n' +
' - Or pass ffmpegPath option to startRecording()' ' - Or pass ffmpegPath option to startRecording()'
); );