Skip to content

Commit

Permalink
fix: the montage output path is now relative to the vtt directive vtt
Browse files Browse the repository at this point in the history
  • Loading branch information
Paxx committed Apr 17, 2023
1 parent 4be3e66 commit fd0335e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sprite/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func (s *service) extract(seek int) string {
seekString := strconv.Itoa(seek)
now := time.Now()
output := random_helper.Generate(5, random_helper.AZAndCaps) + fmt.Sprintf("%d", now.UnixMilli()) + ".png"
outputPath := path.Join(path.Dir(s.flags.Input), output)
cmd := exec.Command(
"ffmpeg",
"-ss",
Expand All @@ -64,13 +65,13 @@ func (s *service) extract(seek int) string {
fmt.Sprintf("scale=%dx%d", s.flags.Width, s.flags.Height),
"-frames",
"1",
output,
outputPath,
)
_, err := cmd.CombinedOutput()
if err != nil {
panic(fmt.Sprintf("failed to extract frame: %v", err))
}
return output
return outputPath
}

func (s *service) Montage(frames []string) {
Expand Down

0 comments on commit fd0335e

Please sign in to comment.