darkwood/media-bundle
Symfony CLI tool that converts a YAML video script into per-scene assets (voice and video), saves generation state, and outputs a render manifest. Supports Replicate-based providers, benchmark mode, and clear output file locations.
TrueAsyncDriver (Symfony v8.1.1) introduces asynchronous processing capabilities, enabling Laravel to leverage non-blocking video generation. This aligns with Laravel’s queue system for background jobs, reducing latency in user-facing workflows.
GenerateVideoJob::dispatch($yamlPath)->onQueue('videos');
TrueAsyncDriver suggests the tool now supports asynchronous scene rendering, which could be critical for Laravel’s scalability.Process facade or Artisan::call() can still invoke the tool, but jobs should leverage the new async driver for performance.
$process = new Process(['php', 'bin/console', 'app:video:generate', '--async', $yamlPath]);
$process->setTimeout(null); // Non-blocking
$process->start();
VideoJob model with status field: pending, processing, completed).illuminate/console) should remain compatible. Test with Laravel 10.x+.8.1.1 and verify no conflicts with Laravel’s Symfony dependencies./tmp/video_assets/).storage_path('app/temp/') for intermediates and clean them up post-job.shouldQueue() with exponential backoff and a dead-letter queue.fake() or a custom AsyncDriver stub.Queue::fake() and verify asset cleanup on failure.symfony/process). Test with Laravel 10.x+.composer why-not to check for conflicts and pin the tool’s version.welcome_v2.yaml) and document breaking changes.maxAttempts and timeout in the job.Process::terminate() in Laravel’s job failure handler.TrueAsyncDriver handle errors (e.g., crashes mid-generation)? Can Laravel recover or must it restart the entire job?videos) with separate workers for async video jobs?TrueAsyncDriver enables Laravel to offload video generation to queues, improving scalability and user experience.GenerateVideoJob to wrap the tool’s async CLI call:
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Support\Facades\Process;
class GenerateVideoJob implements ShouldQueue {
use Queueable;
public function handle() {
$process = new Process([
'php', 'bin/console', 'app:video:generate', '--async', $this->yamlPath
]);
$process->setTimeout(null);
$process->start();
// Poll for completion or use tool-specific status API
while ($process->isRunning()) {
sleep(1);
}
$this->saveManifest();
}
}
GenerateVideoJob::dispatch($yamlPath)->onQueue('videos');
storage/app/video_assets/{video_id}/ (symlinked to public).storage/app/video_manifests/{video_id}.json.storage_path('app/temp/video_assets/') for async intermediates.welcome_v2.yaml) to avoid schema drift.VIDEO_ASYNC_DRIVER=true
VIDEO_ASYNC_CONCURRENCY=4 # Max parallel scenes
.env to pass these to the tool:
putenv('VIDEO_ASYNC_DRIVER=' . env('VIDEO_ASYNC_DRIVER'));
Phase 1: Async Driver Validation (1–2 days)
8.1.1 and test the async driver locally:
composer require darkwood/media-bundle:8.1.1
php bin/console app:video:generate --async examples/video.yaml
storage/app/temp/.README.md with async setup and cleanup procedures.Phase 2: Laravel Job Wrapper (2–3 days)
GenerateVideoJob (as above) to:
--async flag.Video model.public function handle() {
$process = new Process
How can I help you explore Laravel packages today?