alimoezzi / zoomrec

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

zoomrec

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

Docker Pulls GitHub issues GitHub Workflow Status GitHub Workflow Status GitHub Workflow Status 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


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/kastldratza/zoomrec:master
  • kastldratza/zoomrec:latest

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


Usage

  • Container saves recordings inside container 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 CSV 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)

CSV structure

CSV must be fromatted as in example/meetings.csv

  • Delimiter must be a semicolon ";"
  • Only meetings with flag "record = true" are joined and recorded
  • "description" is used for filename when recording
  • "duration" in minutes (+5 minutes to the end)
weekday time duration id password description record
monday 09:55 60 111111111111 741699 Important_Meeting true
monday 14:00 90 222222222222 321523 Unimportant_Meeting false

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 folder for recordings and set permissions (on Host)

mkdir -p recordings
chown -R 1000:1000 recordings

Flags

Set timezone (default: Europe/Berlin)

docker run -d --restart unless-stopped \
  -e TZ=Europe/Berlin \
  -v $(pwd)/recordings:/home/zoomrec/recordings \
  -v $(pwd)/example/meetings.csv:/home/zoomrec/meetings.csv:ro \
  -p 5901:5901 \
kastldratza/zoomrec:latest

Set debugging flag

  • screenshot on error
  • record joining
  • do not exit container on error
docker run -d --restart unless-stopped \
  -e DEBUG=True \
  -v $(pwd)/recordings:/home/zoomrec/recordings \
  -v $(pwd)/example/meetings.csv:/home/zoomrec/meetings.csv:ro \
  -p 5901:5901 \
kastldratza/zoomrec:latest

Windows / cmd

docker run -d --restart unless-stopped \
  -v %cd%\recordings:/home/zoomrec/recordings \
  -v %cd%\example\meetings.csv:/home/zoomrec/meetings.csv:ro \
  -p 5901:5901 \
kastldratza/zoomrec:latest

Windows / PowerShell

docker run -d --restart unless-stopped \
  -v ${PWD}/recordings:/home/zoomrec/recordings \
  -v ${PWD}/example/meetings.csv:/home/zoomrec/meetings.csv:ro \
  -p 5901:5901 \
kastldratza/zoomrec:latest

Linux / macOS

docker run -d --restart unless-stopped \
  -v $(pwd)/recordings:/home/zoomrec/recordings \
  -v $(pwd)/example/meetings.csv:/home/zoomrec/meetings.csv:ro \
  -p 5901:5901 \
kastldratza/zoomrec:latest

Customization example

Add meetings.csv to image

# Switch to example directory
cd example

# Build new image by customized Dockerfile
docker build -t kastldratza/zoomrec-custom:latest .

# Run image without mounting meetings.csv
# Linux
docker run -d --restart unless-stopped -v $(pwd)/recordings:/home/zoomrec/recordings -p 5901:5901 kastldratza/zoomrec-custom:latest

# Windows / PowerShell
docker run -d --restart unless-stopped -v ${PWD}/recordings:/home/zoomrec/recordings -p 5901:5901 kastldratza/zoomrec-custom:latest

# Windows / cmd
docker run -d --restart unless-stopped -v %cd%\recordings:/home/zoomrec/recordings -p 5901:5901 kastldratza/zoomrec-custom:latest

Supported actions

  • Show when the next meeting starts
  • Join a Meeting from csv
    • with id and password
    • with url
  • 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
    • Sign In to Join
  • Breakout Rooms
  • ...

Testing

Create unittests for different use cases:

  • Join meeting
  • Start / Stop ffmpeg and check if file was created
  • ...

Tested with

  • Ubuntu 20.04
    • Desktop
    • Server
  • macOS
  • Windows 10

Contributing

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

About

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

License:MIT License


Languages

Language:Python 84.2%Language:Dockerfile 10.5%Language:Shell 5.3%