Skip to content

Commit

Permalink
Change the tpad to the full duration of the transition
Browse files Browse the repository at this point in the history
* When ffmpeg does an xfade, it happens during the first video (not
  half of the first and half of the second).  So the tpad has to be
  applied to the first video.
  • Loading branch information
chrisvire committed Jun 28, 2022
1 parent fc8044b commit 4a8234d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ffmpeg/ffmpeg.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func MergeTempVideos(Images []string, Transitions []string, TransitionDurations
fmt.Printf("%dth merge has transition %s and duration %f\n", i, transition, transition_duration)
}
//add time to the video that is sacrificied to xfade
settb += fmt.Sprintf("[%d:v]tpad=stop_mode=clone:stop_duration=%f[v%d];", i, transition_duration/2, i)
settb += fmt.Sprintf("[%d:v]tpad=stop_mode=clone:stop_duration=%f[v%d];", i, transition_duration, i)

//get the current video length in seconds
video_each_length[i] = GetVideoLength(fmt.Sprintf(path.Join(tempPath, "temp%d-%d.mp4"), i, totalNumImages))
Expand Down

0 comments on commit 4a8234d

Please sign in to comment.