Use Case: Automated Video Ad Generation
FreshScenario
You have an e-commerce site with hundreds of product pages. You want to automatically generate video ads for each product to use in social media advertising campaigns.
Architecture
Implementation Steps
1. Extract Product URLs
Pull product URLs from your catalog, CMS, or sitemap.
2. Batch Create Links
For each URL, create a link object to scrape product data:
- POST /api/links/ for each product URL
- Validate scraped data (title, description, media)
- Use /api/links/with_params/ for products with poor scrape results
3. Generate Video Previews
Create URL-to-video tasks in parallel batches:
- Start with 5-10 concurrent tasks
- Use preview mode (1 credit/30s) for cost efficiency
- Poll all tasks in a unified loop
4. Quality Selection
For each preview batch:
- Review generated previews (manual or automated)
- Select best preview per product
- Flag products needing regeneration
5. Render Final Videos
Render selected previews at full quality:
- POST /{id}/render/ for each selected preview
- 4 credits/30s per render
- Poll for completion
6. Distribute to Ad Platforms
Upload completed videos to advertising platforms with appropriate metadata.
Cost Estimate
| Products | Duration | Preview Cost | Render Cost | Total |
|---|---|---|---|---|
| 10 | 30s each | 10 credits | 40 credits | 50 |
| 50 | 30s each | 50 credits | 200 credits | 250 |
| 100 | 30s each | 100 credits | 400 credits | 500 |
| 500 | 30s each | 500 credits | 2000 credits | 2500 |
Best Practices
TIP
- Preview first -- Always generate previews before rendering to catch issues early
- Batch wisely -- Process 10-20 products at a time to manage costs and quality
- Aspect ratios -- Generate 9:16 for TikTok/Reels and 16:9 for YouTube
- Credit budget -- Set a per-product credit limit and monitor usage
- Retry failed -- Some URLs may fail; retry with with_params and manual data
See Also
- URL to Video SOP -- Step-by-step procedure
- URL to Video Pipeline -- Full pipeline diagram
- Batch Production -- Scaling guide