Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Library to take screenshots and record video from desktop

Project description

Screen Recorder SDK

Library to take screenshots and record videos

I use Desktop Duplication API to capture desktop and Media Foundation API to record video.

For screenshots it cuts process window from desktop while for videos it captures full display without cutting for better performance

DDA works stable only for Windows >= 10

Installation

First option is:

git clone https://github.com/Andrey1994/screen_recorder_sdk
cd screen_recorder_sdk
cd python
pip install .

ALso you can install it from PYPI:

pip install screen_recorder_sdk

Simple Sample

import sys
import time
import numpy

from screen_recorder_sdk import screen_recorder


def main ():
    screen_recorder.enable_dev_log ()
    pid = int (sys.argv[1])
    screen_recorder.init_resources (pid)

    screen_recorder.get_screenshot (5).save ('test_before.png')

    screen_recorder.start_video_recording ('video1.mp4', 30, 8000000, True)
    time.sleep (5)
    screen_recorder.get_screenshot (5).save ('test_during_video.png')
    time.sleep (5)
    screen_recorder.stop_video_recording ()

    screen_recorder.start_video_recording ('video2.mp4', 30, 8000000, True)
    time.sleep (5)
    screen_recorder.stop_video_recording ()

    screen_recorder.free_resources ()

if __name__ == "__main__":
    main ()

More samples

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for screen-recorder-sdk, version 1.0.2
Filename, size File type Python version Upload date Hashes
Filename, size screen_recorder_sdk-1.0.2-py3-none-any.whl (238.7 kB) File type Wheel Python version py3 Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page