fix: video visualizer

This commit is contained in:
Karma Riuk 2023-08-27 19:35:40 +02:00
parent 741db457fb
commit b8546a4d57

View File

@ -25,7 +25,6 @@ func (v *VideoVisualizer) Init(*maze.Maze) {
panic(err) panic(err)
} }
v.ffmpeg_cmd = path v.ffmpeg_cmd = path
println(path)
} }
func (v *VideoVisualizer) Run(lets_go chan<- bool) { lets_go <- true } func (v *VideoVisualizer) Run(lets_go chan<- bool) { lets_go <- true }
@ -44,8 +43,8 @@ func (v *VideoVisualizer) Visualize(solved_chan <-chan *maze.SolvedMaze) {
img_writer := writer.ImageWriter{ img_writer := writer.ImageWriter{
Filename: path.Join(tmp_dir, fmt.Sprintf("%07v.png", i)), Filename: path.Join(tmp_dir, fmt.Sprintf("%07v.png", i)),
Maze: solved, Maze: solved,
CellWidth: 2, CellWidth: 5,
CellHeight: 2, CellHeight: 5,
WallColor: color.Black, WallColor: color.Black,
PathColor: color.White, PathColor: color.White,
SolutionGradient: colorgrad.Warm(), SolutionGradient: colorgrad.Warm(),
@ -61,7 +60,7 @@ func (v *VideoVisualizer) Visualize(solved_chan <-chan *maze.SolvedMaze) {
"-y", "-y",
"-pattern_type", "glob", "-pattern_type", "glob",
"-i", path.Join(tmp_dir, "*.png"), "-i", path.Join(tmp_dir, "*.png"),
"-framerate", fmt.Sprint(v.Framerate), "-r", fmt.Sprint(int(v.Framerate)),
v.Filename, v.Filename,
) )
err = cmd.Run() err = cmd.Run()