Skip to content

Commit

Permalink
Added usage messages to the scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
m-elwin committed May 14, 2020
1 parent 64f158b commit 47d5f9b
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 19 deletions.
1 change: 0 additions & 1 deletion video_audio_merge
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ then
printf "$usage"
exit 1
fi
set -x
ffmpeg -i "$2" -i "$3" -c:v copy -c:a aac -strict experimental "$1"
11 changes: 8 additions & 3 deletions video_concat
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/bin/bash
#losslessly concatenate video files while keeping audio good
# see https://trac.ffmpeg.org/wiki/Concatenate#protocol
# USAGE: video_concat output.mp4 input1.mp4 ... inputN.mp4
usage="losslessly concatenate video files while keeping audio good
see https://trac.ffmpeg.org/wiki/Concatenate#protocol
USAGE: video_concat output.mp4 input1.mp4 ... inputN.mp4"
if [[ -z "$1" ]] || [[ -z "$2" ]]
then
printf "$usage"
exit 1
fi
concmd="concat:"
output="$1"
shift
Expand Down
18 changes: 9 additions & 9 deletions video_extract
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash
# Extract a portion of a video (works for pure audio too)
# USAGE:
# video_extract output input start_time to end_time
# video_extract output input start_time for duration
# start and end time is in the format
# HH:MM::SS.frac
# duration is the length of the clip
usage="Extract a portion of a video (works for pure audio too)
USAGE:
video_extract output input start_time to end_time
video_extract output input start_time for duration
start and end time is in the format
HH:MM::SS.frac
duration is the length of the clip"

case $4 in
"to")
Expand All @@ -15,8 +15,8 @@ case $4 in
flag=-t
;;
*)
echo "Error Specify to or for"
exit
printf "$usage"
exit 1
;;
esac

Expand Down
12 changes: 9 additions & 3 deletions video_get_audio
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/bin/bash
usage="Extract audio from a video file
USAGE: video_get_audio output input
"

# Extract audio from a video file
# USAGE: video_get_audio output input
ffmpeg -i "$2" -vn -ab 256 "$1"
if [[ -z $2 ]]
then
printf "$usage"
exit 1
fi
ffmpeg -i "$2" -vn -ab 256 "$1"
12 changes: 9 additions & 3 deletions video_mute
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/bin/bash
# Mute a video file
# USAGE: video_mute output.mp4 input.mp4
ffmpeg -i "$2" -an "$1"
usage="Mute (i.e., remove all sound from) a video file
USAGE: video_mute output.mp4 input.mp4
"
if [[ -z "$2" ]]
then
printf "$usage"
exit 1
fi
ffmpeg -i "$2" -an "$1"

0 comments on commit 47d5f9b

Please sign in to comment.