use fmt.Fprintf
to write to the file directly
...instead of creating a new string with `fmt.Sprintf` and writing it with to the file separately.
This commit is contained in:
parent
ab3b47d66b
commit
2b0a0dbcf5
1 changed files with 3 additions and 3 deletions
|
@ -17,12 +17,12 @@ func makeConcatDemuxFile(manifest UgoiraManifest, frameDescFile *os.File) {
|
|||
frames := manifest.Body.Frames
|
||||
for _, frame := range frames {
|
||||
frameDur := float32(frame.Delay) / 1000 // convert to seconds
|
||||
frameDescFile.WriteString(fmt.Sprintf("file '%s'\n", frame.File))
|
||||
frameDescFile.WriteString(fmt.Sprintf("duration %f\n", frameDur))
|
||||
fmt.Fprintf(frameDescFile, "file '%s'\n", frame.File)
|
||||
fmt.Fprintf(frameDescFile, "duration %f\n", frameDur)
|
||||
}
|
||||
// repeat last frame (see: https://trac.ffmpeg.org/wiki/Slideshow#Concatdemuxer
|
||||
lastFrame := frames[len(frames)-1]
|
||||
frameDescFile.WriteString(fmt.Sprintf("file '%s'\n", lastFrame.File))
|
||||
fmt.Fprintf(frameDescFile, "file '%s'\n", lastFrame.File)
|
||||
}
|
||||
|
||||
func callFFmpeg(frameDescPath, outputFilePath, workDir, ffmpegArgs string) error {
|
||||
|
|
Loading…
Add table
Reference in a new issue