aboutsummaryrefslogtreecommitdiffstats
path: root/cli/flv2mp4.sh
diff options
context:
space:
mode:
Diffstat (limited to 'cli/flv2mp4.sh')
-rwxr-xr-xcli/flv2mp4.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/cli/flv2mp4.sh b/cli/flv2mp4.sh
new file mode 100755
index 0000000..f331c88
--- /dev/null
+++ b/cli/flv2mp4.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# Convert FLV to MP4 with ffmpeg and preserving original encodings.
+#
+# Credit:
+# [1] FFMPEG convert flv to mp4 without losing quality
+# http://superuser.com/a/727081
+#
+# Aaron LI
+# Created: 2015-12-28
+#
+
+if [ $# -ne 1 ] && [ $# -ne 2 ]; then
+ echo "Usage: `basename $0` <file.flv> [file.mp4]"
+ exit 1
+fi
+
+INFILE="$1"
+OUTFILE="$2"
+[ -z "${OUTFILE}" ] && OUTFILE="${INFILE%.flv}.mp4"
+
+ffmpeg -i "${INFILE}" -codec copy "${OUTFILE}"
+