Created
November 17, 2021 20:49
-
-
Save ford-prefect/308671af377373cf528cba615a68f19b to your computer and use it in GitHub Desktop.
mp4 remuxing script
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/bash | |
set -e | |
if [ $# -ne 1 ]; then | |
echo "Usage: ${0} <recording.mp4>" | |
exit 255 | |
fi | |
oldfile="${1}" | |
newfile="${1/.mp4/-fixed.mp4}" | |
if [ "${oldfile}" = "${newfile}" ]; then | |
echo "File must have a .mp4 extension" | |
exit 254 | |
fi | |
gst-launch-1.0 \ | |
filesrc location="${oldfile}" ! qtdemux name=d \ | |
mp4mux name=m ! filesink location="${newfile}" \ | |
d. ! queue ! h264parse ! m. \ | |
d. ! queue ! aacparse ! m. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment