This script is designed to split large MP4 video files (> 4GB) into smaller chunks (< 4GB) to comply with the FAT32 file system limits.
It is particularly useful for preparing videos to fit on a FAT32 formatted USB drive for devices like a Raspberry Pi to read.
The script processes each MP4 file in the Videos
folder (for >4GB MP4 files) and splits it into smaller segments saving the split files in the Rendered
folder (< 4GB MP4 files FAT32 compatible).
This script was part of a personal project detailed on my website
Make sure you have ffmpeg
installed on your system. You can install it using Homebrew:
brew install ffmpeg
-
Clone the repository and cd into it:
git clone https://github.com/dennisrcao/FAT32-Split-MP4-Script.git cd FAT32-Split-MP4-Script
-
**Create input and output folders **: Create two folders named Videos and Rendered in the root of the cloned repository:
mkdir Videos Rendered
-
Prepare media: Add Larger MP4 files ( > 4GB) you want to split into "Videos"
-
Run the Script: Make the script executable and run it:
chmod +x script_split-mp4.sh ./script_split-mp4.sh
-
Segmented MP4 videos will be "Rendered"
I left another script in there called script_rename-mp4.sh
which renames every file in the directory it sits in with a random variable. This is useful in the application of putting a bunch of videos on a USB stick where you want to randomize the playback order.
It's important that this script sits in the same folder as all the files you want to rename.
In order to run it,
bash chmod +x script_rename-mp4.sh ./script_rename-mp4.sh
This project is licensed under the MIT License. See LICENSE (c) 2024 Dennis Cao. dennis-cao.net