AVI to MP4 v0.2

Download Description : Convert any avi files to psp (mp4). Using MPEG4 video codec (480×272), and AAC audio codec.

License : Open Source (GPLv3)
Released : May 8, 2008
Filesize : 1.2 KB
Type : Bash Script
OS : Linux (any)
MD5 : 47f1016315b90f1ebff70108be4bd251
Installation : 1. Open terminal
2. Change directory to where you downloaded the file.
3. Type: chmod +x ./avi2mp4.sh (this sets permission)
Usage : — Type: ./avi2mp4 * (where you have your video files)

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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
# avi2mp4 v0.2 by EMCGFX
# Convert avi files to mp4 for psp.
# Using MPEG4 video and AAC audio codecs.
# Original Script mpg2avi By Steel_J
# Convert mpeg streams into high quality mpeg4 avi with mp3 audio.
# requirements: mplayer/mencoder
 
# Usage:
# 0. chmod +x avi2mp4.sh
# 1. copy this script to any folder with avi files.
# 2. execute the script, ./avi2mp4.sh *
# (to remove spaces from filenames)
# 3. execute the script, ./avi2mp4.sh
# (to start converting all the files in directory)
 
# v0.2
# changed: replaced _ with . character in filenames.
# changed: -o "'basename "$i"'.mp4" to -o ""$i".mp4";
# removed: current_directory=$( pwd )
 
# v0.1 -- first release.
 
# Begin
clear
 
# remove spaces
for i in *.[Aa][Vv][Ii];
  do mv "$i" `echo $i | tr ' ' '.'`;
done > /dev/null 2>&1 &
 
# remove uppercase
for i in *.[Aa][Vv][Ii];
  do mv "$i" `echo $i | tr '[A-Z]' '[a-z]'`;
done > /dev/null 2>&1 &
 
# convert avi movies into mp4's with mencoder
for i in *.[Aa][Vv][Ii];
do nice -n 10 mencoder -ovc lavc -oac lavc -of lavf \
-lavcopts aglobal=1:vglobal=1:vcodec=mpeg4:vbitrate=800:\
threads=4:acodec=libfaac -af lavcresample=24000 \
-vf scale=480:272,harddup -lavfopts format=psp \
-ofps 30000/1001 $i -o ""$i".mp4";
echo "Finished";
done
exit;

Leave a comment

Your comment

Yandex Mail.ru Google LiveJournal myOpenId Flickr claimId Blogger Wordpress OpenID Yahoo Technorati Vidoop Verisign AOL