-
-
Save parzibyte/194608d6281a06a8b13778f3c4f9ee89 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def obtener_frame_camara(): | |
ok, frame = camara.read() | |
if not ok: | |
return False, None | |
agregar_fecha_hora_frame(frame) | |
# Escribir en el vídeo en caso de que se esté grabando | |
if grabando and archivo_video is not None: | |
archivo_video.write(frame) | |
# Codificar la imagen como JPG | |
_, bufer = cv2.imencode(".jpg", frame) | |
imagen = bufer.tobytes() | |
return True, imagen | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment