I found this. sounds like what you want.
However, in order to get this to work, I had to switch the acodec=aac option to acodec=libfaac, which if I'm not mistaken, requires "libfaac0" (sudo apt-get install mencoder libfaac0).
In the end, the command looks like this:
Code:
mencoder -ofps 30000/1001 -af lavcresample=24000 -vf harddup -of lavf \
-oac lavc -ovc lavc -lavcopts aglobal=1:vglobal=1:vcodec=mpeg4:acodec=libfaac \
-lavfopts format=psp \
input.video -o output.psp
To make a script to automate this for multiple files:
Code:
#!/bin/bash
# In case user forgets to input file names
if [ $# -eq 0 ]
echo "USAGE: avi2psp <FILE(S)>";
exit 1;
fi
# For each input file
for FILE in "$@"
do
mencoder -ofps 30000/1001 -af lavcresample=24000 -vf harddup -of lavf \
-oac lavc -ovc lavc -lavcopts aglobal=1:vglobal=1:vcodec=mpeg4:acodec=libfaac \
-lavfopts format=psp $FILE -o ${FILE%.[^.]*}.psp
done
If you're new to shell scripting, the backslashes ("\") allow a command to run over more than one line, "$@" creates a strings of all the input arguments, which in this case will be the input files that the for loop cycles through, and the whole "${FILE%.[^.]*}" expression removes the extension from the file currently being processed so it can be replaced with ".psp" (I can't guarantee it will work perfectly in every case).
Also, don't forget to give the script executable permissions:Then you can run it:
Code:
./avi2psp video1 video2 etc
Bookmarks