Skip to content

Instantly share code, notes, and snippets.

@chiawendt
Last active June 7, 2019 10:22
Show Gist options
  • Select an option

  • Save chiawendt/7a64f1066897caadb7f7ee940775b42a to your computer and use it in GitHub Desktop.

Select an option

Save chiawendt/7a64f1066897caadb7f7ee940775b42a to your computer and use it in GitHub Desktop.

Revisions

  1. chiawendt revised this gist Jun 7, 2019. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions ffcut
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,7 @@ inPath=$1
    start=$2
    end=$3
    outPath=@$1
    fileDate=$(date -Rr ${inPath})

    if [ -z ${end} ]
    then
    @@ -19,3 +20,5 @@ ffmpeg \
    -i ${inPath} \
    -c copy \
    ${outPath}

    touch -d "${fileDate}" ${outPath}
  2. chiawendt created this gist Jan 27, 2019.
    21 changes: 21 additions & 0 deletions ffcut
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    #!/bin/bash

    inPath=$1
    start=$2
    end=$3
    outPath=@$1

    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}