WhatsApp status updates are a popular way to share short video clips with your contacts. However, WhatsApp has a limitation where video status updates must be 30 seconds or less in duration. To make it easier to create these short video clips, you can use a simple bash script that splits a longer video into multiple 30-second segments.
Before we dive into the script, ensure you have the following prerequisites:
- A Linux or macOS system.
- FFmpeg installed on your system. You can typically install it using your system's package manager.
The script below splits a video file named input.mp4 into 30-second segments named output-1.mp4, output-2.mp4, and so on, until the original video is fully split.
time=0
for i in {1..12}
do
ffmpeg -i input.mp4 -ss $time -t 30 output-$i.mp4
((time = i * 30))
done-
Place the script code in a text editor and save it with a
.shextension, for example,split_video.sh. -
Open a terminal and navigate to the directory containing the script.
-
Make the script executable by running the following command:
chmod +x split_video.sh
-
Place the video file you want to split in the same directory as the script and name it
input.mp4. -
Run the script using the following command:
./split_video.sh
-
The script will split the video into 30-second segments, and you'll find the resulting clips named as
output-1.mp4,output-2.mp4, and so on. -
You can now use these segmented video clips as WhatsApp status updates without worrying about the 30-second duration limit.
This script simplifies the process of creating WhatsApp video status updates by automatically splitting a longer video into 30-second clips. It's a handy tool to have in your arsenal for sharing your favorite moments with friends and family through WhatsApp statuses.