cursor-recorder

Records mouse movement to a file and opens it in After Effects. Use with OBS Studio as an external Python script or if you prefer a more manual approach, using the standalone Python script. Then use the After Effects script to import the generated cursor movement data. This is an open-source project you can check out on GitHub.

How to use
With OBS (manually)
  1. Import the cursor_recorder_for_obs.py in OBS. (You need to do this just once).
    1. 2. Go to Tools -> Scripts.
    2. Make sure you have a Python interpreter set in your settings (Scripts -> Python Settings).
    3. Click the ➕ icon (Add Scripts) and select the cursor_recorder_for_obs.py.
    4. Make sure the script is enabled. (It is by default).
    5. Click Install Python modules if you don't have pyautogui and/or keyboard packages installed.
  2. You're ready to start recording. The *.txt will be saved in the same place as your video with the same name.
  3. Stop the recording.
  4. Import the cursor_recorder_for_afterfx.jsx in After Effects. (You need to do this just once).
    1. Open After Effects.
    2. Go to File -> Scripts -> Import from file.
    3. Choose the cursor_recorder_for_afterfx.jsx.
    4. If the cursor_recorder_for_afterfx.jsx doesn't appear in File -> Scripts restart After Effects.
  5. Run the cursor_recorder_for_afterfx.jsx script.
    1. Make sure you have a composition open.
    2. Click File -> Scripts -> cursor_recorder_for_afterfx.jsx.
    3. Choose the file with the cursor movement data.
    4. Your animated null is created.
    5. Do whatever you want with it from here. Check out the Examples section below!
Example After Effects expressions:
more examples on GitHub
SMOOTH FOLLOW (that's from the demo)
JavaScript:
thisLayerScale = transform.scale;
cursorX = thisComp.layer("cursor-recorder-movement").transform.position[0];
cursorY = thisComp.layer("cursor-recorder-movement").transform.position[1];
xvalue = linear(thisLayerScale[0], 100, 200, cursorX + 960, 1920);
yvalue = linear(thisLayerScale[0], 100, 200, cursorY + 540, 1080);
[xvalue - cursorX, yvalue - cursorY];
CURSOR IN CENTER
JavaScript:
// Expression set on video's anchor point
thisComp.layer("cursor-recorder-movement").transform.position;

Development
Python packages
The script requires: pyautogui and keyboard.
You can install them using a single button click in the script's settings when using the OBS script.

Otherwise, install them yourself using this command if you're planning on using the standalone version:

Bash:
$ pip install -r requirements.txt

License
Mozilla Public License Version 2.0
Author
JakubKoralewski
Downloads
2,892
Views
7,536
First release
Last update
Rating
0.00 star(s) 0 ratings

Latest updates

  1. Version 0.4

    Changelog: 1. Now working with FFmpeg. 2. Installs pyautogui and keyboard correctly, I hope...
Top