Edit: You should NOT replace your installed version of mencoder with this one, though 99.9% of the code is just the SVN code. :)
This is basically a hack that I put together myself because I was having sound synch issues and this fixes them. But because I mostly made it for myself, the scale filter is used to determine the width and height to write to the input file for pmp_muxer_avc.pl (I will fix it up over the coming while, but my main focus for now is on looking at adding ogg vorbis support to PMP Mod AVC). My encode script is below. You should use a similar methodology (i.e. encode with sound, extact video, extract audio, pmp mux them).
Code: Select all
#usage <scriptname> inputfile outputfile
BITRATE=450
###########generated muxed video / sound##########
~/install/mencoder_psp/install/mencoder "$1" -vf scale=480:272 -ovc x264 -x264encopts bitrate=$BITRATE:pass=1:turbo=1:threads=2 -srate 44100 -oac mp3lame -lameopts vol=0:mode=0:cbr:br=128 -o /dev/null
~/install/mencoder_psp/install/mencoder "$1" -vf scale=480:272 -ovc x264 -x264encopts bitrate=$BITRATE:pass=2 -srate 44100 -oac mp3lame -lameopts vol=0:mode=0:cbr:br=128 -o "$2".temp
###########rename x264 file##########
mv x264file.txt "$2".264.txt
###########copy video out##########
~/install/mencoder_psp/install/mencoder "$2".temp -ovc copy -nosound -o "$2".264
###########copy sound out##########
~/install/mencoder_psp/install/mencoder "$2".temp -srate 44100 -oac copy -ovc copy -of rawaudio -o "$2".mp3
##########generate pmp file##########
~/install/pmpmux/pmp_muxer_avc.pl -v "$2".264 -a "$2".mp3 -o "$2".pmp -w 480 -h 272
#clean up:
if [ -f "$2".pmp ]
then
echo "Found PMP. Cleaning up temp files."
rm "$2".264.txt "$2".264 "$2".mp3 "$2".temp
exit 0
fi
echo "**********************************************"
echo "PMP file wasn't found. Temp files not deleted."
echo "**********************************************"
You can download version 0.0.1 here.
I'll make the source code available at some point over the next few days for those that wish to compile in their own codec support, etc.
One request: If anyone uses this, could they let me know by replying to this thread; It will determine whether or not I bother making updates publicly available.