From 9cfa12b36420ce1863bf8787a6c0da4777f5358a Mon Sep 17 00:00:00 2001 From: AWoloszyn Date: Wed, 13 Mar 2019 11:34:16 -0400 Subject: [PATCH] Make gapit video behave like gapit screenshot. This outputs the resulting video relative to CWD if not otherwise specified. Fixes #1863 --- cmd/gapit/video.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/gapit/video.go b/cmd/gapit/video.go index 0294162a80..2905e581da 100644 --- a/cmd/gapit/video.go +++ b/cmd/gapit/video.go @@ -25,6 +25,7 @@ import ( "image/png" "io" "os" + fp "path/filepath" "strings" "sync/atomic" @@ -263,7 +264,7 @@ func (verb *videoVerb) writeFrames(ctx context.Context, filepath string, vidFun if outFile == "" && filepath == "" { return fmt.Errorf("need output file argument") } else if outFile == "" { - outFile = file.Abs(filepath).ChangeExt("").System() + outFile = file.Abs(fp.Base(filepath)).ChangeExt("").System() } else { pth := file.Abs(outFile) if pth.Ext() != "" && !strings.EqualFold(pth.Ext(), ".png") { @@ -311,7 +312,7 @@ func (verb *videoVerb) encodeVideo(ctx context.Context, filepath string, vidFun if out == "" && filepath == "" { return fmt.Errorf("need output file argument") } else if out == "" { - out = file.Abs(filepath).ChangeExt(".mp4").System() + out = file.Abs(fp.Base(filepath)).ChangeExt(".mp4").System() } mpg, err := os.Create(out) if err != nil {