Skip to content

Instantly share code, notes, and snippets.

@ford-prefect
Created November 17, 2021 20:49
Show Gist options
  • Save ford-prefect/308671af377373cf528cba615a68f19b to your computer and use it in GitHub Desktop.
Save ford-prefect/308671af377373cf528cba615a68f19b to your computer and use it in GitHub Desktop.
mp4 remuxing script
#!/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