Skip to content

Commit

Permalink
chore(local): decrease mass ffmpeg logs (#7073)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mmx233 authored Aug 24, 2024
1 parent 868b0ec commit d92744e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/local/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ func isSymlinkDir(f fs.FileInfo, path string) bool {

func GetSnapshot(videoPath string, frameNum int) (imgData *bytes.Buffer, err error) {
srcBuf := bytes.NewBuffer(nil)
err = ffmpeg.Input(videoPath).Filter("select", ffmpeg.Args{fmt.Sprintf("gte(n,%d)", frameNum)}).
stream := ffmpeg.Input(videoPath).
Filter("select", ffmpeg.Args{fmt.Sprintf("gte(n,%d)", frameNum)}).
Output("pipe:", ffmpeg.KwArgs{"vframes": 1, "format": "image2", "vcodec": "mjpeg"}).
WithOutput(srcBuf, os.Stdout).
Run()

if err != nil {
GlobalArgs("-loglevel", "error").Silent(true).
WithOutput(srcBuf, os.Stdout)
if err = stream.Run(); err != nil {
return nil, err
}
return srcBuf, nil
Expand Down

0 comments on commit d92744e

Please sign in to comment.