mirror of https://bitbucket.org/ausocean/av.git
cmd/rv/probe.go address comments on latest commit
This commit is contained in:
parent
8e06cffade
commit
ec4f34b117
|
@ -134,12 +134,14 @@ func (tp *turbidityProbe) Close() error {
|
|||
func (tp *turbidityProbe) turbidityCalculation() error {
|
||||
var imgs []gocv.Mat
|
||||
img := gocv.NewMat()
|
||||
|
||||
// Write byte array to a temp file.
|
||||
file, err := os.CreateTemp("temp", "video*.h264")
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create temp file: %w", err)
|
||||
}
|
||||
tp.log.Log(logger.Debug, "writing to file", "buffer size(bytes)", tp.buffer.Len())
|
||||
|
||||
_, err = file.Write(tp.buffer.Bytes())
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to write to temporary file: %w", err)
|
||||
|
|
Loading…
Reference in New Issue