Skip to content

Commit b7b4496

Browse files
committed
docs: improve documentation and add troubleshooting guide
- Added docs/troubleshooting.md covering FFmpeg, MCP, and LLM issues. - Updated docs/README.md to include troubleshooting and remove broken links. - Updated docs/development.md with contribution guidelines and monorepo tips. - Enhanced docs/api.md with Project JSON and WebSocket payload examples. - Added troubleshooting link to root README.md.
1 parent 1851805 commit b7b4496

5 files changed

Lines changed: 193 additions & 1 deletion

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ https://github.com/user-attachments/assets/f2d5a46b-36f4-4433-a7dc-18d0f2070d78
7272
- `pnpm dev:backend`: Start only backend
7373
- `pnpm build`: Build all packages
7474

75+
## Troubleshooting
76+
77+
Facing issues? Check our [Troubleshooting Guide](./docs/troubleshooting.md) for common solutions.
78+
7579
## Documentation
7680

7781
For detailed documentation, please visit the [docs/](./docs/) directory:

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ The editor leverages the power of GitHub Copilot and other AI models to provide
1818
- [MCP Tools & Servers](./mcp-tools.md) - A complete list of available AI tools and servers.
1919
- [Development Guide](./development.md) - How to set up, build, and contribute to the project.
2020
- [Security](./security.md) - Security considerations and sandboxing.
21+
- [Troubleshooting](./troubleshooting.md) - Common issues and solutions.
2122

2223
## Quick Links
2324

2425
- [Root README](../README.md)
25-
- [Master Plan](../MASTERPLAN.MD)

docs/api.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,93 @@ Broadcasts project updates to all connected clients.
131131
}
132132
}
133133
```
134+
135+
## Data Structures
136+
137+
### Project JSON Example
138+
139+
```json
140+
{
141+
"id": "550e8400-e29b-41d4-a716-446655440000",
142+
"name": "My Epic Video",
143+
"created": "2024-01-26T12:00:00.000Z",
144+
"modified": "2024-01-26T12:30:00.000Z",
145+
"settings": {
146+
"width": 1920,
147+
"height": 1080,
148+
"fps": 30
149+
},
150+
"timeline": {
151+
"duration": 15,
152+
"tracks": [
153+
{
154+
"id": "t1",
155+
"type": "video",
156+
"name": "Background",
157+
"clips": [
158+
{
159+
"id": "c1",
160+
"assetId": "a1",
161+
"trackId": "t1",
162+
"startTime": 0,
163+
"duration": 10,
164+
"sourceStart": 0,
165+
"sourceEnd": 10,
166+
"transform": { "x": 0, "y": 0, "scale": 1, "rotation": 0 }
167+
}
168+
],
169+
"muted": false,
170+
"visible": true
171+
}
172+
],
173+
"markers": []
174+
},
175+
"assets": [
176+
{
177+
"id": "a1",
178+
"name": "sunset.mp4",
179+
"path": "/path/to/assets/sunset.mp4",
180+
"type": "video",
181+
"duration": 60
182+
}
183+
]
184+
}
185+
```
186+
187+
### WebSocket Message Payloads
188+
189+
#### Sending a Message (`copilot.message`)
190+
```json
191+
{
192+
"type": "copilot.message",
193+
"payload": {
194+
"content": "Add a 5 second clip of the sunset to the start of the video",
195+
"projectId": "550e8400-e29b-41d4-a716-446655440000"
196+
}
197+
}
198+
```
199+
200+
#### Receiving a Tool Call (`copilot.tool_call`)
201+
```json
202+
{
203+
"type": "copilot.tool_call",
204+
"payload": {
205+
"tool": "add_asset_to_project",
206+
"args": {
207+
"projectId": "550e8400-e29b-41d4-a716-446655440000",
208+
"filePath": "/assets/sunset.mp4",
209+
"type": "video"
210+
}
211+
}
212+
}
213+
```
214+
215+
#### Project Update Broadcast (`project.updated`)
216+
```json
217+
{
218+
"type": "project.updated",
219+
"payload": {
220+
"project": { ... } // Full project object
221+
}
222+
}
223+
```

docs/development.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,31 @@
7070
3. Extend `BaseMCPServer` from `@ai-video-editor/mcp-utils`.
7171
4. Register your tools.
7272
5. Add the server to the backend configuration in `apps/backend/src/mcp/server-configs.ts`.
73+
74+
## Contributing
75+
76+
We welcome contributions! Please follow these guidelines:
77+
78+
### Branching Policy
79+
- Create a new branch for each feature or bug fix: `git checkout -b feature/your-feature-name`.
80+
- Use descriptive branch names.
81+
82+
### Development Workflow
83+
1. **Fork the repository** (if you don't have push access).
84+
2. **Create a branch** for your changes.
85+
3. **Make your changes**. Ensure you follow the coding style and include tests where applicable.
86+
4. **Run linting**: `pnpm lint`.
87+
5. **Verify your changes**: Start the dev environment (`pnpm dev`) and test the functionality.
88+
6. **Submit a Pull Request**. Provide a clear description of your changes and why they are needed.
89+
90+
### Monorepo Management
91+
This project uses **pnpm workspaces** and **Turbo**.
92+
- To add a dependency to a specific package: `pnpm add <package> --filter <package-name>`.
93+
- To run a command in all packages: `pnpm -r <command>`.
94+
- Common filters: `web`, `backend`, `ffmpeg-server`, `whisper-server`, etc.
95+
96+
### Coding Standards
97+
- Use TypeScript for all new code.
98+
- Follow the existing indentation and formatting (Prettier/ESLint rules).
99+
- Document new functions and classes with JSDoc comments.
100+
- Ensure all public-facing API changes are reflected in `docs/api.md`.

docs/troubleshooting.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Troubleshooting Guide
2+
3+
This guide covers common issues you might encounter while setting up or running the AI Video Editor.
4+
5+
## 1. FFmpeg Issues
6+
7+
### FFmpeg not found
8+
**Symptoms**: Backend fails to start, or video processing tools return errors like "ffmpeg not found".
9+
**Solution**:
10+
- Ensure FFmpeg is installed on your system.
11+
- Add the FFmpeg binary directory to your system's PATH.
12+
- On macOS (Homebrew): `brew install ffmpeg`
13+
- On Ubuntu/Debian: `sudo apt update && sudo apt install ffmpeg`
14+
- On Windows: Download from [ffmpeg.org](https://ffmpeg.org/download.html) and add to Environment Variables.
15+
16+
### FFmpeg version mismatch
17+
**Symptoms**: Errors during specific filtering or encoding operations.
18+
**Solution**: Ensure you are using FFmpeg 4.x or 5.x. Some advanced filters might require newer versions.
19+
20+
## 2. MCP Server Connectivity
21+
22+
### Server fails to connect
23+
**Symptoms**: Backend logs show "Failed to connect to MCP server [name]".
24+
**Solution**:
25+
- Check if the server's entry point exists. For example, `mcp-servers/ffmpeg-server/dist/index.js`.
26+
- If the `dist` folder is missing, run `pnpm build` from the project root.
27+
- Ensure the `node` command is available in your environment.
28+
29+
### Tool execution timeout
30+
**Symptoms**: LLM reports a timeout or the backend logs show "Tool execution timed out".
31+
**Solution**:
32+
- Complex operations like `transcribe_audio` or `render_video` can take time.
33+
- Check system resources (CPU/RAM).
34+
- Increase the timeout in `apps/backend/src/mcp/client-manager.ts` if necessary.
35+
36+
## 3. LLM & API Key Issues
37+
38+
### 401 Unauthorized
39+
**Symptoms**: LLM provider returns an authentication error.
40+
**Solution**:
41+
- Double-check your API keys in `apps/backend/.env`.
42+
- Ensure there are no leading/trailing spaces in the keys.
43+
- If using GitHub Copilot, run `pnpm exec copilot` in `apps/backend` to re-authenticate.
44+
45+
### Model not found
46+
**Symptoms**: Error stating "Model [name] not found".
47+
**Solution**:
48+
- Ensure the `LLM_MODEL` in your `.env` is supported by your provider and your specific API key tier.
49+
- Common models: `claude-3-5-sonnet-20240620`, `gpt-4o`, `gemini-1.5-pro`.
50+
51+
## 4. Frontend & WebSocket Issues
52+
53+
### WebSocket connection failed
54+
**Symptoms**: Frontend shows "Disconnected" or chat messages don't send.
55+
**Solution**:
56+
- Ensure the backend is running on the expected port (default 3001).
57+
- Check if `NEXT_PUBLIC_BACKEND_URL` in `apps/web/.env.local` matches your backend URL.
58+
- If running in a container or cloud environment, ensure WebSocket ports are exposed.
59+
60+
### Mixed Content Errors
61+
**Symptoms**: Browser blocks requests to the backend.
62+
**Solution**: If the frontend is served over HTTPS, the backend must also be over HTTPS (WSS for WebSockets). For local development, HTTP/WS is fine.
63+
64+
## 5. Whisper Server Issues
65+
66+
### Model downloading fails
67+
**Symptoms**: Whisper server hangs or fails on the first transcription.
68+
**Solution**:
69+
- The first time it runs, it may attempt to download the Whisper model. Ensure you have an internet connection.
70+
- Check disk space. Models can be several hundred MBs to a few GBs.

0 commit comments

Comments
 (0)