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 :: const in python 3 
Python :: dbscan clustering of latitudes and longitudes 
Python :: subtract 2 datetime objects django 
Python :: intersect and count in sql 
Python :: django get without exception 
Python :: center fig legend 
Python :: Insert Multiple Images to Excel with Python 
Python :: python forward and bachward seperators 
Python :: unpad zeros from string python 
Python :: jet 4 access python password 
Python :: how to put words into list 
Python :: django create view filter options 
Python :: appending hdf5 files 
Python :: installing intelpython3_core using anaconda 
Python :: train chatterbot using yml 
Python :: addind scheduling of tasks to pyramid python app 
Python :: dd-mm-yy to yyyy-mm-dd in python 
Python :: how to copy items in list n times in list python 
Python :: python fibbonacci 
Python :: how to check if a column exists before alter the table 
Python :: Get Dates Between Two Ranges 
Python :: list all subdirectories up to a level 
Python :: django force download file 
Python :: mechanize python #6 
Python :: Saving a copy of rcParams settings. 
Python :: python sys replace text 
Python :: pandas within group pairwise distances 
Python :: scipy z value to pvalue 
Python :: python regex type hint 
Python :: how to make pictures whit python 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =