aboutsummaryrefslogtreecommitdiffstats
path: root/cli/flv2mp4.sh
blob: f331c8885965b33f55b1712e256e0e32fe20f251 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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}"