A modern, browser-based tool for creating precise audio cue points from YouTube videos. Download, visualize, and edit audio with sample-accurate playback and synchronized video display.
- YouTube Video Download: High-quality video and audio extraction using
yt-dlp - Sample-Accurate Audio: Web Audio API-based playback with precise timing
- Interactive Waveform: Visual audio representation with Wavesurfer.js
- Synchronized Video: Muted video display that follows audio playback
- Cue Point Management: Create, edit, and trigger cue points with keyboard shortcuts
- Real-time Sync: Audio-first architecture with < 50ms video sync tolerance
- Dual File Processing: Separate H.264 video (no audio) and PCM WAV audio files
- RESTful API: Clean backend API for video processing and file management
- Modern Frontend: React + Vite with Tailwind CSS styling
- Cross-Platform: Works on macOS, Linux, and Windows
- No Re-encoding: Stream copying for fast processing
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Frontend β β Backend β β Processing β
β (React) β β (Node.js) β β (yt-dlp + β
β β β β β ffmpeg) β
β β’ Wavesurfer.js βββββΊβ β’ Express API βββββΊβ β
β β’ Web Audio API β β β’ File serving β β β’ Download β
β β’ Video sync β β β’ CORS enabled β β β’ Audio extract β
β β’ Cue points β β β’ Static files β β β’ Video process β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
- Audio Master: Web Audio API controls playback timing
- Video Follower: HTML5 video syncs to audio context
- Cue Points: Sample-accurate seeking using
AudioBufferSourceNode - Monitoring: Continuous sync loop maintains < 50ms drift
System Dependencies:
# Install yt-dlp
pip install yt-dlp
# Install ffmpeg
# macOS
brew install ffmpeg
# Ubuntu/Debian
sudo apt update && sudo apt install ffmpeg
# Windows - Download from https://ffmpeg.org/download.htmlNode.js:
- Node.js >= 16.0.0
- npm or yarn
-
Clone the repository:
git clone https://github.com/yourusername/youtube-cue-point-editor.git cd youtube-cue-point-editor -
Install backend dependencies:
npm install
-
Install frontend dependencies:
cd frontend npm install cd ..
-
Start the development servers:
Backend (Terminal 1):
npm run dev # Server runs on http://localhost:3001Frontend (Terminal 2):
cd frontend npm run dev # Frontend runs on http://localhost:5173
-
Open your browser: Navigate to
http://localhost:5173
- Enter YouTube URL: Paste any YouTube video URL into the input field
- Download & Process: Click download to extract video and audio files
- Load in Editor: Files automatically load into the waveform editor
- Set Cue Points: Click on the waveform or use keyboard shortcuts
- Name & Trigger: Label cue points and trigger them with hotkeys
- Sync Playback: Watch video sync perfectly with audio playback
- Space: Play/Pause
- Left/Right Arrow: Seek backward/forward
- Number Keys (1-9): Trigger cue points
- Shift + Number: Set cue point at current position
- Enter: Set cue point with custom name
POST /api/download
Content-Type: application/json
{
"url": "https://www.youtube.com/watch?v=VIDEO_ID"
}Response:
{
"status": "success",
"videoFile": "video-title-1234567890-video.mp4",
"audioFile": "video-title-1234567890-audio.wav",
"duration": 242.57,
"filename": "video-title-1234567890",
"title": "Original Video Title"
}GET /api/downloadsGET /downloads/{filename}youtube-cue-point-editor/
βββ π frontend/ # React frontend application
β βββ π src/
β β βββ π components/ # React components
β β β βββ CuePointEditor.jsx # Main cue point interface
β β β βββ VideoPlayer.jsx # Synchronized video player
β β β βββ WaveformPlayer.jsx # Wavesurfer.js integration
β β β βββ UnifiedVideoEditor.jsx # Combined editor
β β βββ π hooks/ # Custom React hooks
β β β βββ useCueKeyboardMap.js # Keyboard shortcut handling
β β β βββ useVideoSync.js # Audio-video synchronization
β β βββ App.jsx # Main app component
β β βββ main.jsx # Entry point
β βββ package.json # Frontend dependencies
β βββ vite.config.js # Vite configuration
βββ π downloads/ # Generated media files (gitignored)
βββ server.js # Express server setup
βββ downloadController.js # YouTube download logic
βββ package.json # Backend dependencies
βββ README.md # This file
βββ YouTube_Cue_Point_Editor_PRD.md # Product requirements
βββ .gitignore # Git ignore patterns
Backend:
PORT- Server port (default: 3001)NODE_ENV- Environment mode (development/production)
Frontend:
VITE_API_URL- Backend API URL (default: http://localhost:3001)
Downloaded files follow this pattern:
- Video:
{slug-title}-{timestamp}-video.mp4 - Audio:
{slug-title}-{timestamp}-audio.wav
Where {slug-title} is a URL-safe version of the YouTube video title.
Test the backend:
# Health check
curl http://localhost:3001/health
# Download a video
curl -X POST http://localhost:3001/api/download \
-H "Content-Type: application/json" \
-d '{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"}'
# List downloads
curl http://localhost:3001/api/downloadsTest the frontend:
- Open
http://localhost:5173 - Enter a YouTube URL
- Click "Download Video"
- Verify waveform loads and video syncs
cd frontend
npm run test"yt-dlp not found"
pip install yt-dlp
# Verify: yt-dlp --version"ffmpeg not found"
# macOS
brew install ffmpeg
# Ubuntu/Debian
sudo apt install ffmpeg
# Verify: ffmpeg -versionCORS errors
- Ensure backend is running on port 3001
- Check frontend is configured to use correct API URL
Video not syncing
- Verify both video and audio files loaded successfully
- Check browser console for Web Audio API errors
- Ensure files are properly decoded
Backend debugging:
DEBUG=* npm run devFrontend debugging:
- Open browser developer tools
- Check Network tab for API calls
- Monitor Console for errors
- Stream Copying: No video re-encoding for faster processing
- Web Workers: Audio processing in background threads
- Efficient Sync: Optimized sync loop with minimal CPU usage
- Caching: Downloaded files cached locally
- Memory Management: Proper cleanup of audio buffers
- Input Validation: YouTube URLs validated before processing
- Path Sanitization: File paths constrained to downloads directory
- CORS Configuration: Properly configured for frontend integration
- No Code Execution: User input never executed as code
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- yt-dlp - YouTube video downloading
- FFmpeg - Audio/video processing
- Wavesurfer.js - Waveform visualization
- React - Frontend framework
- Vite - Build tool and dev server
Built with precision timing and professional audio workflows in mind. Perfect for DJs, producers, and audio engineers who need sample-accurate cue points.