remux.sh for remuxing obs recordings to mp4 and preserve audio tracks
authorEinar Jørgen Haraldseid <einar@haraldseid.net>
Tue, 13 Jul 2021 10:37:02 +0000 (12:37 +0200)
committerEinar Jørgen Haraldseid <einar@haraldseid.net>
Tue, 13 Jul 2021 10:37:02 +0000 (12:37 +0200)
remux.sh [new file with mode: 0755]

diff --git a/remux.sh b/remux.sh
new file mode 100755 (executable)
index 0000000..94a14d5
--- /dev/null
+++ b/remux.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+for mkvfile in *.mkv; do
+  filename=${mkvfile%.mkv}
+  ffmpeg -i "${mkvfile}" -c:a copy -c:v copy -map 0:0 -map 0:1 -map 0:2 -map 0:3 -map 0:4 -movflags faststart "${filename}.mp4"
+  if [[ ${?} == 0 ]]; then
+    rm "${mkvfile}"
+  fi
+done