Last active
July 25, 2016 09:31
-
-
Save k1000/161ee686c42ad6bade75c0a2528022bf to your computer and use it in GitHub Desktop.
Split an input video into multiple output video chunks
This file contains hidden or 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
#!/bin/bash | |
START=$(date +%s); | |
filename=$(basename "$1") | |
segment_times=$2 | |
extension="${filename##*.}" | |
filename="${filename%.*}" | |
output=$filename_%d.$extension | |
ffmpeg -i "$1" -f segment -segment_times "$segment_times" -vcodec copy -acodec copy "$output" | |
END=$(date +%s); | |
echo "" | |
echo $((END-START)) | awk '{print int($1/60)":"int($1%60)}' | |
echo "`date +%Y-%m-%H_%M:%M` $1" >> ~/capture-log.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
fix audio sync problem
http://alien.slackbook.org/blog/fixing-audio-sync-with-ffmpeg/
https://wjwoodrow.wordpress.com/2013/02/04/correcting-for-audiovideo-sync-issues-with-the-ffmpeg-programs-itsoffset-switch/