summaryrefslogtreecommitdiffstats
path: root/convert2mp4
blob: b2efd8d39d7de99576a22310f04a6b553c15a0ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
#----------------------------------------------------
# Version:      0.1.2
# Author:       Florian "Bluewind" Pritz <f-p@gmx.at>
#
# Copyright (C) 2009 Florian Pritz
#
# Licensed under GNU General Public License v3
#   (see COPYING for full license text)
#
#----------------------------------------------------
# Converts a file to an MP4 which can be played in a flash movie
# Video: H264
# Audio: MPEG-4 AAC
#----------------------------------------------------

for i in "$@"; do
  pushd . &> /dev/null
  cd "$(dirname "$i")"

  file="$(basename "$i")"
  file_mp4="$(echo ${file} | sed 's/\(.*\)\..*/\1/').mp4"

  ffmpeg -i "$file" -b 400000 -deinterlace -vcodec libx264 -s 720x576 -r 25 -g 250 -keyint_min 25 -coder ac -me_range 16 -subq 5 -sc_threshold 40 -acodec libfaac -ab 160000 -ar 44100 -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -i_qfactor 0.71 -b_strategy 1 -threads 2 -crf 30 -y "$file_mp4"
  qt-faststart "$file_mp4" "done_$file_mp4"
  popd &> /dev/null
done