This project provides scripts to process videos using Cloudinary's AI features to generate accessibility content including:
- 🎬 Auto-chaptering - AI-generated video chapters
- 📝 Auto-transcription - Speech-to-text conversion
- 🌍 Multi-language translation - Transcripts in 10 languages
- Node.js (v14 or higher)
- Cloudinary account with API credentials
- A subscription to the Google Translation add-on, which you can try for free.
-
Clone the repository:
git clone <your-repo-url> cd video-tutorial-accessibility
-
Install dependencies:
npm install
-
Set up environment variables: Create a
.envfile with your Cloudinary credentials:CLOUDINARY_CLOUD_NAME=your_cloud_name_here CLOUDINARY_API_KEY=your_api_key_here CLOUDINARY_API_SECRET=your_api_secret_here
Get these values from your Cloudinary Dashboard.
Process one video at a time:
# Process a single video node cloudinary-video-ai-processing.js my-video-id # With options node cloudinary-video-ai-processing.js my-video-id --type=authenticated --notification-url=https://example.com/webhookProcess multiple videos efficiently:
# Process multiple videos from command line node batch-process-videos.js video1 video2 video3 # Process videos from file (recommended for many videos) node batch-process-videos.js --file=video-ids.txt # Parallel processing (faster, default: 2 concurrent) node batch-process-videos.js --file=video-ids.txt --parallel=3 # Sequential processing (safer for large batches) node batch-process-videos.js --file=video-ids.txt --sequentialnpm run process my-video-id # Single video npm run batch video1 video2 # Multiple videos npm run batch-file # From video-ids.txt filevideo-tutorial-accessibility/ ├── cloudinary-video-ai-processing.js # Single video processor ├── batch-process-videos.js # Batch processor ├── video-ids.txt # List of video IDs to process ├── package.json # Project dependencies ├── .env.example # Environment template └── README.md # This file The script automatically generates transcripts in the following languages:
- 🇫🇷 French (France & Canada)
- 🇪🇸 Spanish
- 🇩🇪 German
- 🇵🇹 Portuguese (Portugal & Brazil)
- 🇮🇳 Hindi
- 🇯🇵 Japanese
- 🇨🇳 Chinese (Simplified)
- 🇻🇳 Vietnamese
For each processed video, Cloudinary will generate:
{video-id}-chapters.vtt- Video chapters/timestamps{video-id}.transcript- Main transcript (original language){video-id}.{language}.transcript- Translated transcripts
Example for video my-tutorial:
my-tutorial-chapters.vtt my-tutorial.transcript my-tutorial.fr-FR.transcript my-tutorial.es.transcript my-tutorial.de.transcript ... | Option | Description | Example |
|---|---|---|
--type | Asset type (upload, private, authenticated) | --type=authenticated |
--notification-url | Webhook URL for completion notifications | --notification-url=https://example.com/webhook |
--invalidate | Invalidate cached versions | --invalidate |
--parallel=NUM | Number of parallel processes (batch only) | --parallel=3 |
--sequential | Process videos one at a time (batch only) | --sequential |
--file=FILE | Read video IDs from file (batch only) | --file=my-videos.txt |
Add your video public IDs to video-ids.txt, one per line:
# Lines starting with # are comments video-1 folder/video-2 tutorials/advanced-video -
Missing dependencies:
npm install
-
Invalid credentials:
- Check your
.envfile - Verify credentials in Cloudinary Dashboard
- Check your
-
Video not found:
- Ensure video exists in your Cloudinary account
- Include folder path if video is in a subfolder
- Check video public ID spelling
-
API rate limits:
- Use sequential processing for large batches
- Reduce parallel processing concurrency
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Commit changes:
git commit -am 'Add feature' - Push to branch:
git push origin feature-name - Submit a pull request
This project is licensed under the ISC License - see the package.json file for details.
For issues and questions:
- Check the Cloudinary Documentation
- Review the troubleshooting section above
- Open an issue in this repository