
The machine can not only diagnose DTCs but also code vehicle modules. The recorded video can be found within this project as shown below.MB SD C4 Compact is a popular Mercedes Benz diagnostic tool widely used in repair shops and dealers. Execution of the code terminates once the recording has been completed and the mp4 file has been created. Once the code has been executed and the user has entered the desired video duration, the recording begins. # Write the frame into the file 'recording.mp4': # This conversion ensures that the recording exactly resembles the content that had been recordedįrame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) # Use cvtColor() method to convert image from BGR to RGB color format: # screenshot() -> Returns an Image object # Identify the time at which recording must stop: # This is done because, code must be executed up till line #33, prior to recording initiation. # Buffer time to ensure that the recorded video duration is as specified by user: # time() -> Returns the time as a floating point number expressed in secondsĭuration = int(input('Specify recording duration in seconds: ')) # Read screen recording duration via user input: Output = cv2.VideoWriter("recording.mp4", fourcc, 20.0, dimension) # Constructor parameters-> video filename, video codec, video frame-rate(fps), screen dimensions # VideoWriter -> This class provides C++ API for writing video files or image sequences # Define codec -> FourCC is a 4-byte code used to specify the video codec # Store screen dimensions within a tuple: Refer to the code’s comments for an explanation regarding the code.

Then, within the main.py file in thi s project, type the below-specified code. pywin32: Module encapsulating the Windows Win32 API.pyautogui: Cross-platform GUI automation Python module, used to programmatically control the mouse and keyboard.


Below attached is a simple demonstration of this functionality. One of them is recording the display screen, that is, creating a screen recorder using the pyautogui module. Python is a widely-used general-purpose language, that allows a variety of tasks to be performed. Hey there! In this tutorial, we will be learning to build a Screen Recorder using Python in P圜harm.
