feat: ffmpeg select specific frame and frame(n) filter

* select frame after process

* restrict frame selected

* selected frame meta

* test: update golden files

* available index
This commit is contained in:
Adrian Shum 2022-10-13 16:52:59 +08:00 committed by GitHub
parent 4d71837fb8
commit a4f23c6560
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 68 additions and 44 deletions

View file

@ -8,6 +8,7 @@ import (
"github.com/gabriel-vasile/mimetype"
"go.uber.org/zap"
"io"
"strconv"
"strings"
)
@ -127,6 +128,11 @@ func (p *Processor) Process(ctx context.Context, in *imagor.Blob, params imagorp
if err = av.ProcessFrames(); err != nil {
return
}
case "frame":
n, _ := strconv.Atoi(filter.Args)
if err = av.SelectFrame(n); err != nil {
return
}
}
}
meta := av.Metadata()