Skip to content

Instantly share code, notes, and snippets.

@mauricioprado00
Created March 29, 2020 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mauricioprado00/c1c2f0b707333e67524daaba080b4740 to your computer and use it in GitHub Desktop.
Save mauricioprado00/c1c2f0b707333e67524daaba080b4740 to your computer and use it in GitHub Desktop.
Split mkv file in two
#!/usr/bin/env bash
file=$1
time1=$2
time2=$3
echo "Two commands"
time ffmpeg -v quiet -y -i ${file} -vcodec copy -acodec copy -ss 00:00:00 -t ${time1} -sn part_1_${file}
time ffmpeg -v quiet -y -i ${file} -vcodec copy -acodec copy -ss ${time1} -t ${time2} -sn part_2_${file}
# see https://stackoverflow.com/questions/5651654/ffmpeg-how-to-split-video-efficiently
#echo "One command"
#time ffmpeg -v quiet -y -i input.ts -vcodec copy -acodec copy -ss 00:00:00 -t 00:30:00 \
# -sn test3.mkv -vcodec copy -acodec copy -ss 00:30:00 -t 01:00:00 -sn test4.mkv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment