Closed
Description
Hello! I'd like to ask about the snapshot example about generating pictures. I plan to save every frame of the video stream from the camera to a directory on the server. Do I just need to use io. Writer writes bytes to os. File object is fine. Delete the return code below:
`// Encode to (RGB) jpeg
buffer := new(bytes.Buffer)
if err = jpeg.Encode(buffer, img, nil); err != nil {
panic(err)
}
// Serve image
w.Header().Set("Content-Type", "image/jpeg")
w.Header().Set("Content-Length", strconv.Itoa(len(buffer.Bytes())))
// Write jpeg as HTTP Response
if _, err = w.Write(buffer.Bytes()); err != nil {
panic(err)
}
return`
Metadata
Metadata
Assignees
Labels
No labels