Created
February 22, 2024 16:05
-
-
Save DiogenesAnalytics/3b4b22e313d9b16039fa4e40c1059432 to your computer and use it in GitHub Desktop.
Cut a video in half using ffmpeg.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
duration=$(ffprobe -i $1 -show_entries format=duration -v quiet -of csv="p=0") | |
half_duration=$(echo "$duration / 2" | bc) | |
ffmpeg -i $1 -map 0 -c copy -f segment -segment_time $half_duration -reset_timestamps 1 output_half%d.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment