From: Einar Jørgen Haraldseid <einar@haraldseid.net>
Date: Tue, 13 Jul 2021 10:37:02 +0000 (+0200)
Subject: remux.sh for remuxing obs recordings to mp4 and preserve audio tracks
X-Git-Url: https://git.slaskete.net/einar-bin/commitdiff_plain/877cd822f81f05e134c20fb26cfcc934b09eebb7?hp=28add313f485df9aaa5b6c4b7b946152fdd78a3a

remux.sh for remuxing obs recordings to mp4 and preserve audio tracks
---

diff --git a/remux.sh b/remux.sh
new file mode 100755
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