Created
March 11, 2021 11:52
-
-
Save ohthehugemanatee/737a6e9b1c12639aca1fd5223690614f to your computer and use it in GitHub Desktop.
Split zoom meeting recordings into two sides
This file contains 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/sh | |
set -eu | |
### Splits a zoom side-by-side recording into separate left and right video files. | |
# Usage: ./split-zoom.sh /path/to/my-zoom-file.mp4 | |
# Outputs ./my-zoom-file_right.mp4 and ./my-zoom-file_left.mp4 | |
# Ensure we have ffmpeg in the PATH: | |
which ffmpeg | |
# Get variants of the source file name. | |
ORIGINAL="$1" | |
NO_PATH_ORIGINAL="${ORIGINAL##*/}" | |
BASENAME="${NO_PATH_ORIGINAL%.*}" | |
echo "========== Splitting ${ORIGINAL} into left and right sides...========== " | |
echo "========== Splitting right side...======== " | |
ffmpeg -i "$ORIGINAL" -filter:v "crop=iw*(1/2):ih*(1/1):iw:0" -c:a copy "${BASENAME}_1_right.mp4" | |
echo "======== ... done!========" | |
echo "========Splitting left side...========" | |
ffmpeg -i "$ORIGINAL" -filter:v "crop=iw*(1/2):ih*(1/1):0:0" -c:a copy "${BASENAME}_left.mp4" | |
echo "========Done!========" | |
error_out() { | |
echo "========Something reported an error. See the output above for details.========" | |
exit 1 | |
} | |
trap "error_out" ERR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment