Skip to content

janmtl/cameraplaysemulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Camera Plays Emulator

A python app that uses the feed from a webcam to send commands to a video game emulator. The output is also automatically streamed to Twitch.tv.

Based on WhereIsTheFish which has been popularly implemented in FishPlaysPokemon.

This project is in cooperation with Alex Leavitt's uscplayspokemon.

Quickstart

  1. Make sure openCV is installed on your system
  2. Start up VBA with your desired ROM
  3. Set Options -> Emulator -> Show speed -> None
  4. Run python lib/run.py

Configuration

See the default configuration that we provide. It has these sections:

CONTROLLER

  • Includes descriptors for a box (TOP, LEFT, BOTTOM, RIGHT)
  • CAPTURE is the capture device (can be rtsp protocol too)
  • MIN_BLOB_WIDTH, MIN_BLOB_HEIGHT filter out blobs in the scanner

EMULATOR

  • Includes descriptors for a box (TOP, LEFT, BOTTOM, RIGHT)
  • WINDOW_NAME the X-window name for the emulator program (we use VBA)
  • LOGDIR directory for logs relative to the lib directory

KEYLOG

  • Includes descriptors for a box (TOP, LEFT, BOTTOM, RIGHT)
  • MAXLEN is the length of the key press history
  • STEP is the pixel width of the keys when rendered in the keylog

INFOPANEL

  • Includes descriptors for a box (TOP, LEFT, BOTTOM, RIGHT)
  • TEXT is the text that serves as a title and will be appended with a timestamp

STAGE

  • Includes descriptors for a box (TOP, LEFT, BOTTOM, RIGHT)

STREAM

  • FFMPEG_BIN is the binary for ffmpeg as you would call it in your terminal
  • FRAMES_PER_SECOND is the rate set for ffmpeg
  • OUTPUT_URI is usually an rtmp protocol URI from Twitch
  • KEY is appended to the OUTPUT_URI when broadcasting

TODO

  • Fix the no emulator error
  • Fix the no log dir error
  • Make the x11grab automatically resize the emulator capture to fit the emulator box on the stage
  • Add timestamps to log
  • Add runtime option for timer init

About

A Python app based on WhereIsTheFish

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages