acidcamGL README

Your guide to setting up and using acidcamGL for real-time video effects.

Windows Screenshot macOS Screenshot Linux Screenshot

Motivation

Just to create something that I can use to create fun video and artwork to share online.

System Requirements

This project requires a system with a good enough graphics card to run OpenGL 3.3 or greater. It will not work on lower specs. Please read this entire document before using the software. On macOS, you may have to grant the Terminal or the application privileges to use the webcam and capture the desktop. This program requires a significant amount of RAM. If you wish to run with lower RAM, set the size of the memory pool with the -8 flag.

Example:

acidcamGL -d 0 -c 1920x1080 -r 1920x1080 -u 30 -8 200

Notes for Windows:

Windows Interface Screenshot

If downloading the Windows setup, be sure to update to the most up-to-date shaders by downloading the project source code and copying the files in the filter/ directory into the same directory in the installation folder. Otherwise, you will be using an outdated list of default filters. The default folder for installation is:

C:\Program Files\LostSideDead\acidcamGL\acidcamGL\acidcamGL_x64

So the shaders directory is:

C:\Program Files\LostSideDead\acidcamGL\acidcamGL\acidcamGL_x64\filters

Requirements

Update: To compile with MIDI support (this is still in development), install rtmidi on Debian. It's called:

librtmidi-dev

make -f Makefile.midi.linux
sudo make -f Makefile.midi.linux install

Or on macOS use:

make -f Makefile.midi
sudo make -f Makefile.midi install

To Configure Your MIDI Controller, Follow These Steps:

MIDI Configuration Screenshot

On Windows:

On Linux/MacOS:

export AC_MIDI=/Users/jared/acidcamGL/midi.midi_cfg

Your MIDI controller should now be configured and ready for use with the program. Be sure to run the correct acidcamGL program, as the Linux and macOS Makefiles give the program different names.

How to Compile on macOS:

This project requires libacidcam, GLFW, GLEW, OpenGL, OpenCV, and FFmpeg.

First, install Homebrew: https://brew.sh

Then install GLFW, GLEW, OpenGL, OpenCV, FFmpeg:

brew install glfw3 glew opencv ffmpeg

Depending on what you have installed, this could take quite some time. You can choose to statically compile.

Next, download libacidcam:

git clone https://github.com/lostjared/libacidcam.git

Enter the directory:

cd libacidcam

Create a build directory:

mkdir build && cd build

Configure the project:

cmake ..

Build the project:

make -j4

Install the project:

sudo make install

Next, download acidcamGL:

git clone https://github.com/lostjared/acidcamGL.git

Enter the directory:

cd acidcamGL

Create a build directory:

mkdir build && cd build

Configure the project:

cmake ..

Build the project:

make -j4

Install it:

sudo make install

For macOS static build with Syphon, enter the macos-static directory and:

make -j4

You will still need to use install_name_tool on an app bundle. See copy.sh for how to do it.

How to Compile on Linux

First, install the required libraries.

For Linux builds with Desktop capture support (only Xorg, not Wayland), enter the source directory and:

make -f Makefile.linux && sudo make -f Makefile.linux install

Otherwise, follow the same instructions as macOS: clone libacidcam, compile it, install it, clone acidcamGL, compile it, and install it.

Running the Program

Run the program. It's recommended to first export the shell variable SHADER_PATH with the path to filters. Example:

export SHADER_PATH=/home/jared/acidcamGL/filters

Or pass the path when executing the program:

acidcamGL -g -p ../filters

The source/plugin directory contains some test files I have been working on.

Defaults

The default resolution is:

Camera: 1280x720
FPS: 24
Window Size: 1280x720

You can change that using arguments passed to the program.

Arguments

Environment Variables

Keyboard Input

Run the Program:

You will need to either set the SHADER_PATH environment variable or pass the path to the shaders when executing the program with the -p argument. Each shader is listed in an index.txt file in the order you want the program to cycle through them. The program comes with over 100 example shaders.

Example exporting the environment variable:

export SHADER_PATH=/Users/jared/Downloads/acidcamGL/filters

Launch Webcam Device:

acidcamGL -d 0 -g -p filters

Launch Filepath

acidcamGL -i file_path -g -p filters

If your device has a smaller amount of RAM, set the memory pool size in frames. Examples:

acidcamGL -i file_path -g -8 100

or

acidcamGL -i file_path -g -8 500

Full-Screen Monitor 0

acidcamGL -g -p filters -F -M 0

or Monitor 1:

acidcamGL -g -p filters -F -M 1

Windowed Mode 1920x1080 Camera/Window

acidcamGL -g -p filters -c 1920x1080 -r 1920x1080

Windowed Mode 1920x1080 Camera 1280x720

acidcamGL -g -p filters -c 1280x720 -r 1920x1080

Default Windowed Mode:

acidcamGL -g -p filters

Default Fullscreen (Resize) Mode:

acidcamGL -g -p filters -f

Default FullScreen (Windowed) Mode:

acidcamGL -g -p filters -F

Use Webcam Device by Index:

acidcamGL -g -p filters -d 1

Use Different Frames Per Second:

acidcamGL -g -p filters -u 30

Or (if supported by your USB 3.0 Webcam):

acidcamGL -g -p filters -u 60

Or even better:

acidcamGL -g -p filters -u 60 -c 1920x1080 -r 1920x1080

Use Video File as Input:

acidcamGL -g -p filters -i file.mp4

Record to MP4 File:

acidcamGL -g -p filters -i file.mp4 -h -o outfile.mp4

Record as x264 Using FFmpeg:

acidcamGL -g -p filters -i file.mp4 -4 -o output.mp4

Record as x265 Using FFmpeg

acidcamGL -g -p filters -i file.mp4 -5 -o output.mp4

List All Included Filters by Index:

acidcamGL -l

Jump to Location in Video File by Seconds

acidcamGL -g -p filters -i file.mp4 -7 25

Key Shortcut Format:

In a text file, add each line for the desired key shortcuts in this format:

key filter_index shader_index

An example file would be:

F 75 0
Q 25 7

If you saved this to keys.key, you would use it with the -k key like this:

acidcamGL -g -p filters -k keys.key

Playlist File:

Use:

acidcamGL -l

The playlist now uses string names versus ID identifiers. To list the different filters, list them one after the other in a text file line by line like this:

StrobeEffect
SelfAlphaBlend

Save the file, then when in the program, press the L key to toggle the playlist on and off and use the arrow keys to move through the list. To use the playlist file, it's the same as the keys, just with use:

acidcamGL -L playlist.txt -g -p filters

After Enabling Plugins (Used for Testing)

With the shell variable pointing to a path and having the list of plugins in index.txt, load one from the command line using:

acidcamGL -g -p filters -Z plugin.acidcam

The project comes with some example test plugin files in the acidcamGL/source/plugin folder. To compile these, enter the directory and type:

make

This will install the examples in this tree under acidcamGL/plugin. To export these after compiling them, use:

export AC_PLUGIN_PATH=/path/to/acidcamGL/plugin

Add the export commands to your .bash_profile to avoid issuing them every time you start a new session in the terminal.

To Use Stereo Mode:

Have two webcams of the same type and use:

acidcamGL -d camera1_index -6 camera2_index -g -p ./filters -c 1280x720 -r 1280x720 -u 30

This will use camera1-index as the left eye and camera2-index as the right eye with a resolution of 1280x720 at 30 fps.

You can also turn a regular video into stereo mode by using the -x argument:

acidcamGL -i file.mp4 -g -x

Or press the '1' key to toggle stereo on and off.

Press < and > to shuffle through different Color Maps.