Live video on the AT Protocol
at eli/oatproxy-panic 29 lines 499 B view raw
1package cmd 2 3import ( 4 "context" 5 "fmt" 6 "os" 7 8 "stream.place/streamplace/pkg/gstinit" 9 "stream.place/streamplace/pkg/log" 10 "stream.place/streamplace/pkg/media" 11) 12 13func Clip(ctx context.Context, args []string, out string) error { 14 if out == "" { 15 return fmt.Errorf("out is required") 16 } 17 log.Log(ctx, "clip", "out", out) 18 gstinit.InitGST() 19 fd, err := os.Create(out) 20 if err != nil { 21 return err 22 } 23 defer fd.Close() 24 err = media.Clip(ctx, args, fd) 25 if err != nil { 26 return err 27 } 28 return nil 29}