Generate all ffmpeg commands having in a bat file to separate a video (length=00:34:22) named Hajar2025-low2.mp4 into seven files of approximately equal length.
Assistant
Here are the ffmpeg commands to split your video into 7 equal parts:
batch
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Each part will be approximately 4 minutes and 55 seconds long, except the last part which is 4 minutes and 52 seconds to account for the total length of 34:22. The -c copy flag ensures no re-encoding occurs, making the process fast and lossless. The -avoid_negative_ts make_zero helps prevent timestamp issues at the beginning of each segment.
User
Strangely, they are not equal! the first is 28.5mb, second 38.7mb, third 28.5mb, fourth 24.2mb, etc!!!
Assistant
You're right! The file sizes vary because -c copy cuts at keyframe boundaries, not at exact timestamps. When using stream copy, ffmpeg can only cut at I-frames (keyframes), which are typically spaced several seconds apart. This causes the actual cut points to shift, resulting in uneven file sizes.
Here's a solution that re-encodes the video to ensure equal segments:
This will re-encode the video, which takes longer but ensures precise cutting at the exact timestamps. The -crf 23 provides good quality (lower values = higher quality, 18-28 is typical range).
If you want to keep the original quality settings from your source video while still getting equal segments, you can use: