Skip to content

Instantly share code, notes, and snippets.

@mjdorma
Last active August 29, 2015 13:56
Show Gist options
  • Save mjdorma/9045317 to your computer and use it in GitHub Desktop.
Save mjdorma/9045317 to your computer and use it in GitHub Desktop.
pyvbox: Video capture to file.
"""pyvbox: Video capture to file.
"""
import os
import time
import virtualbox
# Assume machine is already running.
vbox = virtualbox.VirtualBox()
machine = vbox.find_machine("win7")
session = machine.create_session()
# Capture 60 seconds of video from the display.
session.machine.video_capture_file = os.path.abspath("test.webm")
session.machine.video_capture_enabled = True
time.sleep(60)
session.machine.video_capture_enabled = False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment