This simple Python script is used to rename MXF files generated from Avid Media Composer to match the Package Name in their metadata.
The script can process a single file or a folder containing multiple MXF files.
This is useful if you want to move native Avid MXF files from Avid Media Composer to Final Cut Pro.
This script is very basic, and doesn't contain any special error handling or messaging. It may not work in all use cases.
You should duplicate the MXF files you want to process prior to using, as there's no "undo" once you run the script.
NOTE: The executable in the Easy Installation below is a lot slower than just running the Python script directly.
Here's a real-world example:
Before:
5bis-01T01A03.E0A869B4CDC3A.mxf
V01.E0A7CD6A_55C5455C54DD8V.mxf
After:
5bis-01-01 - 23Y06M08 - 5bis-01T01.wav.mxf
A016C010_230608_R2QM - A016C010_230608_R2QM.new.01.mxf
You can also use the optional --trimafterspace
argument:
Before:
5bis-01T01A03.E0A869B4CDC3A.mxf
V01.E0A7CD6A_55C5455C54DD8V.mxf
After:
5bis-01-01.mxf
A016C010_230608_R2QM.mxf
Download the latest release from GitHub here.
Unzip the downloaded ZIP and put the rename-avid-mxf
executable somewhere easily accessible like your Desktop.
Open Terminal.app
(you can search for Terminal in Spotlight) and change to the folder which contains the rename-avid-mxf
executable.
PRO TIP: You can do this easily by dragging a folder from Finder to Terminal whilst holding down the COMMAND key.
To process a single MXF file:
./rename-avid-mxf "/path/to/yourfile.mxf"
To process a folder of MXF files:
./rename-avid-mxf "/path/to/folder"
You can also use the optional Trim After Space argument:
./rename-avid-mxf --trimafterspace "/path/to/folder/or/file"
This script will recursively search through the specified folder and rename all MXF files based on their package name.
PRO TIP: You can right-click on files in Finder with the OPTION key held down to copy a file or folders pathname.
- Update binary to be Universal, so that it works on Apple Silicon & Intel Mac's.
- Added
--trimafterspace
argument.
- Initial Release
If you don't want to download a pre-compiled executable, you can trigger the Python Script directly.
- macOS 12 or later
- Homebrew
- Python 3
- MediaInfo CLI and MediaInfo Library
-
If not already installed, install Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
Install Python3 and MediaInfo with Homebrew:
brew install python3 mediainfo libmediainfo
-
Install pymediainfo:
python3 -m pip install pymediainfo
-
Download this repository by clicking here (or by pressing the Code button above then Download ZIP).
-
Double click on the downloaded ZIP file in Finder to unzip it. Put the folder somewhere like your Desktop.
-
Change to the folder which you just unzipped (i.e. the folder which contains the
rename-avid-mxf.sh
andrename-avid-mxf.py
files) and go into the Source folder. You can do this easily by dragging a folder from Finder to Terminal whilst holding down the COMMAND key. -
Make the
rename-avid-mxf.sh
shell script executable:chmod +x rename-avid-mxf.sh
Change to the folder which contains the rename-avid-mxf.sh
and rename-avid-mxf.py
files.
To process a single file:
./rename-avid-mxf.sh "/path/to/yourfile.mxf"
To process a folder:
./rename-avid-mxf.sh "/path/to/folder"
This script will recursively search through the specified folder and rename all MXF files based on their package name.