gocv icon indicating copy to clipboard operation
gocv copied to clipboard

unable to Set FPS

Open ghost opened this issue 2 years ago • 3 comments

Description

unable to change frame per second value.

Steps to Reproduce

// open webcam                                                
webcam, err = gocv.OpenVideoCapture(deviceID)
if err != nil {
    fmt.Printf("Error opening capture device: %v\n", deviceID)
    return
}
defer webcam.Close()

webcam.Set(5, 10)
log.Println(webcam.Get(5))

output

30

Your Environment

  • Operating System and version: Ubuntu 20.04.2 LTS - 64bit
  • OpenCV version used: opencv lib version: 4.5.3
  • How did you install OpenCV? followed this -> https://pkg.go.dev/gocv.io/x/gocv#readme-ubuntu-linux
  • GoCV version used: gocv version: 0.28.0
  • Go version: go1.16.3
  • Did you run the env.sh or env.cmd script before trying to go run or go build? No

ghost avatar Aug 24 '21 06:08 ghost

same problem

xiaoxfan avatar Jan 17 '22 10:01 xiaoxfan

#913 same problem

wgjtyu avatar Mar 04 '22 03:03 wgjtyu

You should use webca.Grab(webcam.Get(gocv.VideoCaptureFPS) - yourFps) to skip frames before calling webcam.Read()

jiekechoo avatar Apr 04 '24 05:04 jiekechoo