#!/bin/sh
#
# BASICS:
#
# The ATI W100 used by the C860 has 384 ko available.
# VGA videos requires :
# 640 * 480 * 12/8/1024=450
# Since 450 > 384, it can't play smoothly
#
# 16/9 is 640x360
# 3/4  is 640x480
#
# To get a decent framerate :
# 640*360*13/8/1024=364
#
# 640x352 is a safer default.
#
# With cccr=163, you can do video 640x352@25 fps, 500k, stereo 44.1kHz 64k vbr
#
# HINTS:
# Try to have audio sampling a multiple of 44.1 kHz (or 48 ?)
# Avoid xvid codec to get a better decoding, use Bvhq (b-frames)
# Do not rotate/crop/resample the video on the zaurus with -vop rotate=1 -vf crop:352:640 -af resample=44100:0:0, but do it during the encoding step

#/opt/mplayer/bin/mencoder.p22 -srate 44100 -oac twolame -twolameopts br=32:mode=mono -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=248 -vop scale=640:352 -ofps 20 $* -o zaurus-movie.avi

/opt/mplayer/bin/mencoder.p22  $* -srate 44100 -oac mp3lame -lameopts abr:br=64:aq=0:mode=0 -ovc lavc -lavcopts vcodec=mpeg4:trell:mbd=2:vqmin=2:vqmax=31:v4mv:vmax_b_frames=1:vb_strategy=0:cmp=2:subcmp=2:precmp=2:predia=1:dia=1:vme=4:vqcomp=0.6:vlelim=9:vcelim=-4:idct=7:lumi_mask=0.05:dark_mask=0.01:vstrict=-1:cbp:vfdct=1:vbitrate=500 -vop pp=hb/vb/dr,scale=640:352,hqdn3d=8:6:12 -vf rotate=1,scale=352:640 -ffourcc DIVX -ofps 25 -zoom -sws 2 -o zaurus-movie-44.1kHz-64k-stereo-500k-25fps.avi

# For playback use:
# mplayer -vo w100 file.avi
# No need to use -fs -dr -framedrop -cache 8192 with the encoding used.
