u2takey / ffmpeg-go

golang binding for ffmpeg
Apache License 2.0
1.66k stars 167 forks source link

Blinking shell window #80

Closed bbars closed 1 year ago

bbars commented 1 year ago

I'm developing an UI application for Windows. Every time ffprobe executes, I see a blinking shell window. It is a platform-specific issue on Windows.

I know here's a flag syscall.SysProcAttr.HideWindow which can fix this issue.

I saw there's a type CompilationOption func(s *Stream, cmd *exec.Cmd), but it was designed for and supported by ffmpeg only.

Also when using ffmpeg there's a workaround:

stream := ffmpeg.Input(filename)
cmd := stream.Compile()
cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
err := cmd.Run()

But when using ffprobe I can't access prepared cmd *exec.Cmd.