From 2f97d8e25a5b18c65a72269ecf0ff23efd4bd8f6 Mon Sep 17 00:00:00 2001 From: eagleshot <****@****.com> Date: Mon, 1 Apr 2024 17:37:25 +0200 Subject: [PATCH] Add functionality to record video and update documentation --- README.md | 16 ++++++++-------- digiCamControlPython.py | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8ff7ec5..02fce92 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # digiCamControlPython -Simple python class to use digiCamControl via the [single command system](https://digicamcontrol.com/doc/userguide/remoteutil) to control your camera. -[Digicamcontrol](https://digicamcontrol.com/) needs to be installed and running. Compatible cameras can be found [here](https://digicamcontrol.com/cameras). +Simple python class to use digiCamControl via the [single command system](https://digicamcontrol.com/doc/userguide/remoteutil) to control your camera. [Digicamcontrol](https://digicamcontrol.com/) needs to be installed and running. Supports cameras from many popular manufacturers such as Nikon, Canon, Sony as well as GoPro. A list of compatible cameras can be found [here](https://digicamcontrol.com/cameras). ## Example code: ``` Python @@ -10,26 +9,27 @@ Simple python class to use digiCamControl via the [single command system](https: import digiCamControlPython as dccp camera = dccp.Camera() -camera.setIso(100) +camera.set_iso(100) >>> Set the Iso to 100 -camera.getShutterspeed() +camera.get_shutterspeed() >>> Current shutterspeed: 1/125 -camera.listCompression() +camera.list_compression() >>> List of all possible compressionsettings: ['JPEG (BASIC)', 'JPEG (NORMAL)', 'JPEG (FINE)', 'RAW', 'RAW + JPEG (BASIC)', 'RAW + JPEG (NORMAL)', 'RAW + JPEG (FINE)'] -camera.setAutofocus("off") +camera.set_autofocus("off") >>> Autofocus is off. -camera.setTransfer("Save_to_PC_only") +camera.set_transfer("Save_to_PC_only") -camera.setFolder(r"C:\Images\") +camera.set_folder(r"C:\Images\") >>> Set the session.folder to C:\Images\ camera.capture() >>> Captured image. >>> Current lastcaptured: Image1.jpg +``` diff --git a/digiCamControlPython.py b/digiCamControlPython.py index 455a619..ec8dc0b 100644 --- a/digiCamControlPython.py +++ b/digiCamControlPython.py @@ -240,6 +240,22 @@ def list_whitebalance(self) -> list: """ return self.__list_cmd("whitebalance") + # %% Video + def start_video(self) -> int: + """ + Start recording a video. + :return: Value indicating the success of the operation + """ + self.show_live_view() # May be necessary + return self.run_cmd("do StartRecord") + + def stop_video(self) -> int: + """ + Stop recording a video. + :return: Value indicating the success of the operation + """ + return self.run_cmd("do StopRecord") + # %% Commands def run_cmd(self, cmd: str) -> int: """