Giter VIP home page Giter VIP logo

beheaded's Introduction

Beheaded

Author: Milan Falešník ([email protected], [email protected]) Generic X window and recording for headless setups.

Installation:

  • pip install Beheaded

Requires Runner python package to be installed (pip handles that).

Usage:

The basic step is to import required objects into namespace

from Beheaded import Headless, Record

Obviously, if you don't need recording, the do not import Record.

Headless:

Headless's constructor signature:

Headless(display="auto", width=1280, height=1024, bit_depth=24)

Headless can be used both in normal and context-managed mode.

X = Headless()
X.start()
... do stuff ...
X.stop()

and

with Headless() as X:
    ... do stuff ...

are functionally equivalent.

Record:

Record's constructor signature:

Record(filename, xvfb, framerate=25)
  • filename specifies the target video file name
  • xvfb specifies the Headless object, or anything that provides width, height and display attributes.

Record can be used both in normal and context-managed mode.

rec = Record("filename.webm", X)
rec.start()
... do stuff ...
rec.stop()

and

with Record():
    ... do stuff ...

are functionally equivalent.

Combining:

Works obviously as expected:

with Headless() as X:
    with Record("filename.webm", X):
        ... do stuff ...

To-Do:

  • add checks whether Xvfb or ffmpeg really run

beheaded's People

Contributors

barthanssens avatar mfalesni avatar monkpit avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

beheaded's Issues

FFmpeg subprocess sometimes hangs

On Debian 7 with ffmpeg/libav and Python 2.7.8

When Record is stopped after having recorded video for a few minutes, the subprocess running ffmpeg sometimes hangs (the size of the videofile does not grow anymore, ffmpeg is not using CPU anymore, so it just waits)

I've written a small patch for this (see pull request nr 1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.