You will need:
Blender (download from the official Blender website).
displacement_tracking.blend Blender file.
exportCSV.py script.
A folder named data (or a custom export folder) to store CSV output.
The video file to analyze.
Step 0 – Setup
Install Blender and verify it runs on your system.
Place the following in your working folder:
Your video file
A subfolder named data (for CSV exports)
Open Blender and confirm that you can load the displacement_tracking.blend file.
Step 1 – Tracking Points in Blender
Open Blender and load the project file:
File → Open → select displacement_tracking.blend.
Switch to the Movie Clip Editor and load your video:
Click Open and select your video.
The video should now appear in the editor.
Define the frame range:
If you only want to analyze part of the video, adjust Start and End frames.
Use Set Scene Frames to sync the scene’s frame range to your selection.
Navigate the video
Use the mouse scroll wheel to change zoom level.
Use the middle mouse button to pan/move the view.
Add tracking markers:
Use Markers → Add (or the equivalent “Add” button).
Click once on the point in the video you want a marker to follow.
After placing it, you can reposition the marker while it is selected (the square should appear white).
Track the marker over time:
With the marker selected, choose Track → Track Forward.
Wait for Blender to iterate through all frames.
Repeat as needed:
Rewind to the start of the video.
Add and track additional markers, one at a time.
Adjust tracking settings if more robust tracking is needed.
Step 2 – Exporting Displacements to CSV
Once all desired markers are tracked, switch to the Scripting workspace at the top of the Blender window.
Locate or open the text editor inside Blender’s Scripting workspace.
Load the export script:
Either copy–paste the contents of exportCSV.py into a new text block, or
Use Open in the text editor to load the existing exportCSV.py file.
Ensure there is a folder named data in your current working directory:
By default, the script writes CSV files into a data/ subfolder.
Run the script:
In the Blender text editor, click Run Script.
The script will loop over all movie clips and tracks and create one CSV per track.
Confirm that output files were created:
Each file is named like tracking_<clipname>_<trackname>.csv.
Columns are: X, Y, frame_number, where X and Y are in pixel coordinates.
Python Scripts
This code deselect all objects and delete the camera object from the scene.
Troubleshooting
Problem:
The export script outputs more CSV files than the number of tracking points you created for your current video.
Likely Cause:
Movie clips or tracking data from previous sessions are still loaded in Blender.
Solution:
List all loaded movie clips in the Python console:
import bpy
for clip in bpy.data.movieclips:
print(clip.name)
Remove unwanted clips by name:
import bpy
bpy.data.movieclips.remove(
bpy.data.movieclips["your_clip_name"]
)
Re-run the exportCSV.py script after cleaning up the unused clips.
Notes
Always verify that your frame range (Start/End) matches the video portion you intend to analyze.
If tracking fails or jumps, consider improving contrast, adjusting tracking settings, or manually correcting markers before exporting.
The exported CSV files are suitable for downstream processing in Python, MATLAB, Excel, or other analysis tools.