1. Install proper ffmpeg:
port install ffmpeg +gpl +lame +x264 +xvid +faac +faad
2. Create an convert.sh file:
#!/bin/sh
mkdir mp4
for file in *.avi; do
/opt/local/bin/ffmpeg -i "$file" -acodec libfaac -ab 128k -ar 48000 \
-s 368x208 -r 29.97 -vcodec libx264 -b 500kb \
-flags +loop -cmp +chroma \
-partitions +parti4x4+partp8x8+partb8x8 \
-me_method umh -subq 6 -trellis 1 \
-refs 2 -bf 1 -coder 1 -me_range 16 -g 300 -keyint_min 25 \
-sc_threshold 40 -i_qfactor 0.71 -maxrate 4M \
-bufsize 4M -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 21 \
-threads 0 "mp4/${file%%.*}.mp4"
done
3. Chmod it:
chmod 777 convert.sh
4. launch it:
./convert.sh
P.S. If you want launch conversion in foreground, just do next steps:
- Open terminal and launch virtual console :
screen - launch convertion
./convert.sh - exit virtual console
ctrl+a, d - close terminal window
if you want to sneek, what happens at your virtual console open it with next command:
screen -r
0 Responses to “Encode PSP video with ffmpeg from command line on mac os x”