You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
958 B

# This is a list of simple shell functions to handle a few inconveniences
# regarding video and audio synchronization.
# When recording a mono source as a stereo, one of the speaker is muted.
# This removes the second (muted) track from the audio source.
/usr/bin/ffmpeg -i "$1" -c:v copy -ac 1 "mono-$1"
# Side note: I record both audio and video with the same file names, besides the extension.
/usr/bin/mpv "$1.mkv" -audiofile "$1.opus"
# Synchronize the audio and video.
if [ $# -ne 4 ]; then
echo "usage: avsync video audio delay output"
return 1
/usr/bin/ffmpeg -i "$1" \
-itsoffset "$3" \
-i "$2" \
-c:a copy -c:v copy -map 0:v:0 -map 1:a:0 \
# Video and audio have the same name, except for the extension.
# Example: avs my-video 1.3
if [ $# -ne 2 ]; then
echo "usage: avs prefix delay"
return 1
avsync "$1".mkv "$1".opus "$2" "$1"-sync.mkv