summaryrefslogtreecommitdiff
path: root/internal/cli/video_runner.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/cli/video_runner.go')
-rw-r--r--internal/cli/video_runner.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/internal/cli/video_runner.go b/internal/cli/video_runner.go
index 2679a26..96cd7cd 100644
--- a/internal/cli/video_runner.go
+++ b/internal/cli/video_runner.go
@@ -12,15 +12,15 @@ import (
// (Veo generation is slow and API quotas make parallelism impractical).
//
// apiKey is the Google/Gemini API key passed by the caller.
-// selected is the list of gallery page numbers to process (from PromptForGalleryVideos).
-// outputDir is both the directory that contains the gallery PNGs and the
-// destination for the resulting MP4 files (written next to the PNGs).
+// selectedPaths contains the absolute (or relative) paths of the gallery PNGs
+// to animate — typically returned by PromptForGalleryVideos.
//
// Each page prints a "Generating…" line before the API call and a "Video saved:"
-// line with the output path on success. The function stops and returns on the
-// first error so callers can log it without silently skipping pages.
-func GenerateSelectedVideos(apiKey string, selected []int, outputDir string) error {
- if len(selected) == 0 {
+// line with the output path on success. The MP4 is written next to its source
+// PNG so that gallery images and their videos stay in the same directory.
+// The function stops and returns on the first error so the caller can log it.
+func GenerateSelectedVideos(apiKey string, selectedPaths []string) error {
+ if len(selectedPaths) == 0 {
return nil
}
@@ -31,12 +31,12 @@ func GenerateSelectedVideos(apiKey string, selected []int, outputDir string) err
ctx := context.Background()
- for _, pageNum := range selected {
- fmt.Printf("Generating video for gallery page %d...\n", pageNum)
+ for _, imgPath := range selectedPaths {
+ fmt.Printf("Generating video for: %s\n", imgPath)
- mp4Path, err := gen.GenerateVideoFromGallery(ctx, outputDir, outputDir, pageNum)
+ mp4Path, err := gen.GenerateVideoFromPath(ctx, imgPath)
if err != nil {
- return fmt.Errorf("cli: generating video for page %d: %w", pageNum, err)
+ return fmt.Errorf("cli: generating video for %s: %w", imgPath, err)
}
fmt.Printf("Video saved: %s\n", mp4Path)