From 4728b37f4ab16b700a1595f8cb95dd80445580a5 Mon Sep 17 00:00:00 2001 From: Prakash Date: Mon, 6 Dec 2021 19:34:26 +0530 Subject: [PATCH] IMEncode now returns NativeByteBuffer In Version: v0.29.0, `gocv.IMEncode(".jpg", img)` returns `gocv.NativeByteBuffer` and not `[]byte`. --- main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index d1fd2e5..0d7ad9e 100644 --- a/main.go +++ b/main.go @@ -82,7 +82,9 @@ func getframes() { } frame_id++ gocv.Resize(img, &img, image.Point{}, float64(0.5), float64(0.5), 0) - frame, _ = gocv.IMEncode(".jpg", img) + frameBytes, _ := gocv.IMEncode(".jpg", img) + frame = frameBytes.GetBytes() + frameBytes.Close() } }