Last active
June 7, 2019 10:22
-
-
Save golopot/7a64f1066897caadb7f7ee940775b42a to your computer and use it in GitHub Desktop.
Cut a video by ffmpeg
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 | |
inPath=$1 | |
start=$2 | |
end=$3 | |
outPath=@$1 | |
fileDate=$(date -Rr ${inPath}) | |
if [ -z ${end} ] | |
then | |
>&2 echo "Usage: ffcut <filename> <start> <end>" | |
exit | |
fi | |
ffmpeg \ | |
-hide_banner \ | |
-y \ | |
-ss ${start} \ | |
-to ${end} \ | |
-i ${inPath} \ | |
-c copy \ | |
${outPath} | |
touch -d "${fileDate}" ${outPath} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment