Skip to content

Instantly share code, notes, and snippets.

@drewr
Created January 10, 2026 16:32
Show Gist options
  • Select an option

  • Save drewr/bb69da4bb939831c0fb82bf923cec530 to your computer and use it in GitHub Desktop.

Select an option

Save drewr/bb69da4bb939831c0fb82bf923cec530 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
INPUT=$*
OUTPUT=$(basename $INPUT .MTS)
### Fast version, just copies streams to mp4, but failed on one MTS file
#echo ffmpeg -i $INPUT -c:v copy -c:a aac ${OUTPUT}.mp4
### Slow version, re-encodes, but works on every file
echo ffmpeg -i $INPUT -y -c:v libx264 -crf 23 -c:a aac -b:a 128k ${OUTPUT}.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment