Explorar el Código

fix kdenlive encoding

David hace 10 años
padre
commit
2e391ad4ce
Se han modificado 1 ficheros con 34 adiciones y 0 borrados
  1. 34 0
      front/fix-file.sh

+ 34 - 0
front/fix-file.sh

@@ -0,0 +1,34 @@
+#!/bin/bash
+
+set -e
+
+if [ $# -ne 2 ]; then
+	echo "usage: $0 in.mp4 out.mp4"
+	exit 1
+fi
+
+if [ ! -f "$1" ]; then
+	echo "$1 doesn't exist"
+	exit 1
+fi
+
+if [ -f "$2" ]; then
+	echo "$2 exists"
+	exit 1
+fi
+
+
+audiofile=$(mktemp).aac
+videofile=$(mktemp).mp4
+
+function finish {
+	rm -f $audiofile
+	rm -f $videofile
+}
+
+trap finish EXIT
+
+ffmpeg -hide_banner -analyzeduration 16M -i "$1" -c:v copy -an -f mp4 -y $videofile
+ffmpeg -hide_banner -analyzeduration 16M -i "$1" -c:a copy -vn -bsf:a aac_adtstoasc -y $audiofile
+
+ffmpeg -hide_banner -i $audiofile -i $videofile -c copy -bsf:a aac_adtstoasc -y "$2"