feat: seek() filter and ffmpeg.SeekPosition, ffmpeg.SeekDuration
* feat: seek() filter and ffmpeg.SeekPosition, ffmpeg.SeekDuration
This commit is contained in:
parent
7350619928
commit
38b1b200ff
11 changed files with 60 additions and 20 deletions
10
processor.go
10
processor.go
|
|
@ -136,6 +136,16 @@ func (p *Processor) Process(ctx context.Context, in *imagor.Blob, params imagorp
|
|||
}
|
||||
}
|
||||
}
|
||||
case "seek":
|
||||
if ts, e := time.ParseDuration(filter.Args); e == nil {
|
||||
if err = av.SeekDuration(ts); err != nil {
|
||||
return
|
||||
}
|
||||
} else if f, e := strconv.ParseFloat(filter.Args, 64); e == nil {
|
||||
if err = av.SeekPosition(f); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
case "max_frames":
|
||||
n, _ := strconv.Atoi(filter.Args)
|
||||
if err = av.ProcessFrames(n); err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue