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
|
|
@ -107,13 +107,21 @@ func (av *AVContext) SelectPosition(f float64) (err error) {
|
|||
func (av *AVContext) SelectDuration(ts time.Duration) (err error) {
|
||||
if ts > 0 {
|
||||
av.selectedDuration = ts
|
||||
if err = seekDuration(av, ts); err != nil {
|
||||
if err = av.SeekDuration(ts); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
return av.ProcessFrames(-1)
|
||||
}
|
||||
|
||||
func (av *AVContext) SeekPosition(f float64) error {
|
||||
return av.SeekDuration(av.positionToDuration(f))
|
||||
}
|
||||
|
||||
func (av *AVContext) SeekDuration(ts time.Duration) error {
|
||||
return seekDuration(av, ts)
|
||||
}
|
||||
|
||||
func (av *AVContext) Export(bands int) (buf []byte, err error) {
|
||||
if err = av.ProcessFrames(-1); err != nil {
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue