Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python record screen

import cv2
import numpy as np
import pyautogui
import keyboard

filename = "record"
screen_size = pyautogui.size()
codec = cv2.VideoWriter_fourcc(*'mp4v')
vid = cv2.VideoWriter(filename + '.mp4', codec, 20, screen_size)

print("Started recording")
while True:
    img = pyautogui.screenshot()
    img = np.array(img)
    frame = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
    vid.write(frame)
    if keyboard.is_pressed('x'):
        break

cv2.destroyAllWindows()
vid.release()
Comment

python record screen and audio

 - Go to Python directory
 - If you have Pygame skip this step otherwise open a terminal and type: pip install pygame
 - In your Python files go to Python/Lib/site_packages/Pygame/examples


for screen-related things go to the 'camera' file 

for the audio-related stuff go to the 'audiocapture' file
Comment

PREVIOUS NEXT
Code Example
Python :: jupyter notebook for loop progress bar 
Python :: group by count dataframe 
Python :: chiffre cesar python 
Python :: an array of dates python 
Python :: how to clear an array python 
Python :: save np array as mat file 
Python :: godot 2d movement 
Python :: python min length list of strings 
Python :: python -m http 
Python :: put array over array in numpy 
Python :: write a python program to find gcd of two numbers 
Python :: codeforces - 570b python 
Python :: os.remove directory 
Python :: bring tkinter window to front 
Python :: pandas read excel 
Python :: não nulo pandas 
Python :: how to save data to text file python 
Python :: How to convert ton to kg using python 
Python :: how to use tensorboard 
Python :: max int value in python 
Python :: alarm clock python 
Python :: make selenium headless python 
Python :: native bold text 
Python :: get difference of images python 
Python :: ubuntu install pip for python 3.8 
Python :: kaaba python tutorial 
Python :: remove newlines from csv 
Python :: how do you count most frequent item in a list in python 
Python :: cv2.adaptiveThreshold() python 
Python :: pyhton return annonymous object 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =