View Single Post
Posts: 75 | Thanked: 35 times | Joined on Jun 2010 @ United States
#9
Originally Posted by paulkoan View Post
This is my script, using ffmpeg and outputs to mp4 container rather than avi container (mp4 is a better option I think):

Code:
#!/bin/bash

outfile=$1
echo "output folder: $outfile"
mkdir -p $outfile
shift

while [ $# -ne 0 ]; do
echo "file = $1"
infile=$1
thefile="${infile%.*}"
mkvfile="$outfile/${thefile##*/}.mkv"
mp4file="$outfile/${thefile##*/}.mp4"
avifile="$outfile/${thefile##*/}.avi"
echo "mkv = $mkvfile"
echo "mp4 = $mp4file"
 #ffmpeg -i "$infile" -s 800x480 -vcodec libx264 -vpre default -vpre baseline -crf 22 -acodec libfaac -ab 128k -ac 2 -f matroska "$mkvfile"
 ffmpeg -i "$infile" -r pal -s 800x448 -vcodec mpeg4 -qmin 3 -qmax 5 -crf 22 -acodec libfaac -ab 128k -ac 2 -f mp4 "$mp4file"
# ffmpeg -i "$infile" -r pal -s 800x448 -vcodec mpeg4 -qmin 3 -qmax 5 -crf 22 -acodec libfaac -ab 128k -ac 2 -f avi "$avifile"

shift
done
To use it, save it as scriptname, and +x it

The format is

scriptname <outputfolder> <inputfile> [inputfile ...]

It will take each of the input files, convert them to mpeg4 + ac3 inside mp4 container and place them into "outputfolder". If you really want avi containers, then comment out the mp4 line and uncomment the following avi line.

If you are using Windows, then there are several converters available, but you may want to start with these settings, they are what I have had the most luck with in terms of performance on the n900.

I would totally welcome any input however...
as far as this script goes... you might have to explain more to me please. i have no experience whatsoever with linux, etc.