Skip to content

8 ‐ Output File Names

Alexander Refsum Jensenius edited this page Sep 1, 2026 · 1 revision

For complete documentation see Preprocessing on the docs site.


Every analysis writes files, and after an afternoon of work a folder can hold dozens. The naming rules here decide what each file is called and whether a re-run replaces the old file or sits beside it—worth two minutes before your first long session, and exactly where to look when a file seems to have vanished.

Every analysis method accepts two parameters that control output file naming:

  • target_name—the output file path. If None (default), a suffix is appended to the source filename in the same directory. For example, history on dance.avi gives dance_history.avi.

  • overwrite—if True (default), an existing file is replaced in place, so re-running a method overwrites the previous result. With overwrite=False, the name is silently incremented instead, keeping every run: dance_history.avidance_history_0.avidance_history_1.avi.

import musicalgestures as mg

mv = mg.MgVideo('/path/to/video.avi')
mv.history(target_name='/output/my_history.avi', overwrite=False)   # keep every run

Clone this wiki locally