Init
This commit is contained in:
parent
264c97183e
commit
3faede7b1c
74 changed files with 6228 additions and 1 deletions
27
util/av/thumbnail.go
Normal file
27
util/av/thumbnail.go
Normal file
|
@ -0,0 +1,27 @@
|
|||
package av
|
||||
|
||||
import (
|
||||
ffmpeg "github.com/u2takey/ffmpeg-go"
|
||||
)
|
||||
|
||||
func ExtractVideoThumbnail(
|
||||
videoPath string,
|
||||
thumbnailPath string,
|
||||
) error {
|
||||
err := ffmpeg.
|
||||
Input(videoPath).
|
||||
Output(thumbnailPath, ffmpeg.KwArgs{
|
||||
"vframes": 1,
|
||||
"f": "image2",
|
||||
"ss": "00:00:01",
|
||||
"c:v": "mjpeg",
|
||||
"q:v": 10, // not sure
|
||||
}).
|
||||
Silent(true).
|
||||
OverWriteOutput().
|
||||
Run()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue