/zoomrec

Record Zoom meetings automatically in headless docker container with Python and FFmpeg

Primary LanguagePythonMIT LicenseMIT

zoomrec

A all-in-one solution to automatically join and record Zoom meetings.

Docker Pulls GitHub Workflow Status


  • Python3 - Script to automatically join Zoom meetings and control FFmpeg
  • FFmpeg - Triggered by python script to start/stop screen recording
  • Docker - Headless VNC Container based on Ubuntu 20.04 with Xfce window manager and TigerVNC

Join a test meeting


This project is a further development of https://github.com/kastldratza/zoomrec. Please also have a look at this repo and leave a star.

Installation

The entire mechanism runs in a Docker container. So all you need to do is install Docker and use the image from Registry.

Requirements

Docker Registry

Docker images are build and pushed automatically to Docker Hub and GitHub Container Registry.

So you can choose and use one of them:

  • ghcr.io/aykborstelmann/zoomrec:master
  • kyatech/zoomrec:latest

For my examples in this README I used kyatech/zoomrec:latest


Usage

  • Container saves recordings at /home/zoomrec/recordings
  • The current directory is used to mount recordings-Folder, but can be changed if needed
    • Please check use of paths on different operating systems!
    • Please check permissions for used directory!
  • Container stops when Python script is terminated
  • Zoomrec uses a YML file with entries of Zoom meetings to record them
    • The csv can be passed as seen below (mount as volume or add to docker image)
  • To "say" something after joining a meeting:
    • paplay (pulseaudio-utils) is used to play a sound to a specified microphone output, which is mapped to a microphone input at startup.
    • paplay is triggered and plays a random file from /home/zoomrec/audio
    • Nothing will be played if directory:
      • does not contain .wav files
      • is not mounted properly

config.yml structure

  • compress - if the recorded file should be compressed afterwards (withour it is recorded with 0 compression as mkv file - 1 hour ~ 1GB)
  • meetings - array of meeting informations:
    • Must contain:
      • description - description/name of the meeting used for filenmae
      • day - weekday on which this meeting occurs
      • time - time on which this meeting occurs
      • duration - duration the zoomrec will stay in meeting and record
    • Either or
      • link - link for the meeting
      • id and password - id and password of the meeting

Example

compress: true
meetings:
  - description: Meeting 1
    link: https://zoom.us/j/111111111111?pwd=741699
    day: monday
    time: '19:22'
    duration: 5
  - description: Meeting 2
    id: 111111111111
    password: 741699
    day: monday
    time: '0:05'
    duration: 5

VNC

You can connect to zoomrec via vnc and see what is happening.

Connect (default)

Hostname Port Password
localhost 5901 zoomrec

Preparation

To have access to the recordings, a volume is mounted, so you need to create a folder that container users can access.

[ IMPORTANT ]

Create folders and set permissions (on Host)

mkdir -p recordings
chown -R 1000:1000 recordings

mkdir -p audio
chown -R 1000:1000 audio

Flags

Set timezone (default: Europe/Berlin)

docker run -d --restart unless-stopped \
  -e TZ=Europe/Berlin \
  -v $(pwd)/recordings:/home/zoomrec/recordings \
  -v $(pwd)/audio:/home/zoomrec/audio \
  -v $(pwd)/config.yml:/home/zoomrec/config.yml:ro \
  -p 5901:5901 \
kyatech/zoomrec:latest

Set debugging flag (default: False)

  • screenshot on error
  • record joining
docker run -d --restart unless-stopped \
  -e DEBUG=True \
  -v $(pwd)/recordings:/home/zoomrec/recordings \
  -v $(pwd)/audio:/home/zoomrec/audio \
  -v $(pwd)/config.yml:/home/zoomrec/config.yml.csv:ro \
  -p 5901:5901 \
kyatech/zoomrec:latest

Windows / cmd

docker run -d --restart unless-stopped \
  -v %cd%\recordings:/home/zoomrec/recordings \
  -v %cd%\audio:/home/zoomrec/audio \
  -v %cd%\config.yml:/home/zoomrec/config.yml:ro \
  -p 5901:5901 \
kyatech/zoomrec:latest

Windows / PowerShell

docker run -d --restart unless-stopped \
  -v ${PWD}/recordings:/home/zoomrec/recordings \
  -v ${PWD}/audio:/home/zoomrec/audio \
  -v ${PWD}/config.yml:/home/zoomrec/config.yml:ro \
  -p 5901:5901 \
kyatech/zoomrec:latest

Linux / macOS

docker run -d --restart unless-stopped \
  -v $(pwd)/recordings:/home/zoomrec/recordings \
  -v $(pwd)/audio:/home/zoomrec/audio \
  -v $(pwd)/config.yml:/home/zoomrec/config.yml:ro \
  -p 5901:5901 \
kyatech/zoomrec:latest

Supported actions

  • Show when the next meeting starts
  • Join a Meeting from csv with id and password
  • Wrong error: Invalid meeting ID / Leave
  • Join with Computer Audio
  • Please wait for the host to start this meeting.
  • Please wait, the meeting host will let you in soon.
  • Enter Full Screen
  • Switch to Speaker View
  • Continuously check: This meeting is being recorded / Continue
  • Continuously check: Hide Video Panel
  • Continuously check: This meeting has been ended by host
  • Quit ffmpeg gracefully on abort
  • Host is sharing poll results
  • This meeting is for authorized attendees only / Leave meeting
  • Play sound after joining a meeting
  • Join a Meeting from csv with url

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.