Skip to content

Commit

Permalink
zero-pad intermediate clip frames to ensure natural ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
mpawlowski committed May 22, 2024
1 parent d268e49 commit 6e7ca67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions timelapse.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ func (t *timelapseGenerator) GenerateTimelapse(ctx context.Context, sourceDir st
}
}

// create video clip from morphed frames
clipFile := path.Join(clipDir, fmt.Sprintf("%d.mp4", i))
// create video clip from morphed frames, ensuring to zero pad the clip number so they sort naturally
clipFile := path.Join(clipDir, fmt.Sprintf("%010d.mp4", i))
err = t.ff.VideoFromImages(ctx, myFrameDir, clipFile, opts.ffmpegOptions...)
if err != nil {
return fmt.Errorf("unable to generate video clip %s: %w", clipFile, err)
Expand Down

0 comments on commit 6e7ca67

Please sign in to comment.