mirror of
https://github.com/u2takey/ffmpeg-go.git
synced 2025-10-05 16:06:52 +08:00
Add support for compilation options
Add options to the Compile function, and in turn, the Run function in order to modify the compiled command instance before executing it. This is helpful to, for example, specify that the command should be run in a separate process group in order for ffmpeg not to react on SIGINTs sent to the parent proces.
This commit is contained in:
@@ -277,6 +277,13 @@ func TestCompile(t *testing.T) {
|
||||
assert.Equal(t, out.Compile().Args, []string{"ffmpeg", "-i", "dummy.mp4", "dummy2.mp4"})
|
||||
}
|
||||
|
||||
func TestCompileWithOptions(t *testing.T) {
|
||||
out := Input("dummy.mp4").Output("dummy2.mp4")
|
||||
cmd := out.Compile(SeparateProcessGroup())
|
||||
assert.Equal(t, cmd.SysProcAttr.Pgid, 0)
|
||||
assert.True(t, cmd.SysProcAttr.Setpgid)
|
||||
}
|
||||
|
||||
func TestPipe(t *testing.T) {
|
||||
|
||||
width, height := 32, 32
|
||||
|
Reference in New Issue
Block a user