Created
November 25, 2025 03:24
-
-
Save openly-retro/e24fbb445390d517f1b8bed3598a55e7 to your computer and use it in GitHub Desktop.
Use FFmpeg to convert a movie file to MKV with open-source/free audio & video codecs
This file contains hidden or 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 | |
| # I use this to convert MOV files from my iphone to more open formats | |
| sourcefile=$1 | |
| sourcefilenoext="${sourcefile%.*}" | |
| sourceasmkv="${sourcefilenoext}.mkv" | |
| ffmpeg -i $sourcefile -c:v libsvtav1 -q:v 7 -c:a libopus $sourceasmkv | |
| touch -r $sourcefile $sourceasmkv | |
| # MOV files created on iphones have a special 'filemodifydate' exif data we can use | |
| exiftool -v "-filename<filemodifydate" -d "%Y%m%d_%H%M%S.mkv" $sourceasmkv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment