OESF Portables Forum
Model Specific Forums => Sharp Zaurus => Zaurus - pdaXrom => Topic started by: kkazakov13 on February 14, 2007, 05:01:17 pm
-
kkazakov13: I notice you have a 3200 also, may I ask how you encode your videos and what mplayer parameters you use when playing them? I always have terrible trouble with this.
[div align=\"right\"][{POST_SNAPBACK}][/a][/div] (http://index.php?act=findpost&pid=154069\")
That's my script I wrote for converting movies:
#!/bin/bash
# default values
MAX_WIDTH=640
MAX_HEIGHT=480
AUDIO_BITRATE=48000
VIDEO_BITRATE=500
# rotate mode
ROTATE=1
# running priority
PROCESS_PRIORITY="-15"
# video/audio setup
VIDEO="lavc"
VIDEO_CODEC="mpeg4"
AUDIO="mp2:abitrate=128"
LAMEOPTS="cbr:br=128:mode=3"
# default values
WANT_SCALE="Y"
#WANT_ROTATE="Y"
# for subtitles only
SUB_ENCODING="cp1251"
# for cropping, comment if none
#CROP="640:336:0:90"
# settings end here, don't modify below
INFILE="$1"
OUTFILE="$2"
SUBFILE="$3"
INFO_LINE=`mplayer "$1" -vo somethingtofail 2>/dev/null | grep ^VIDEO`
INPUT_RES=`echo "$INFO_LINE" | gawk -F" " '{print $3}'`
if [ -z "$INPUT_RES" ]; then
echo ""
echo "*** ERROR: Could not get input resolution, file broken/not existing?"
echo ""
exit
fi
#quick & durty
if [ -z "$OUTFILE" ]; then
OUTFILE="z-$1"
fi
if [ ! -z "$SUBFILE" ]; then
SUB=" -sub $SUBFILE "
fi
INPUT_WIDTH=`echo "$INPUT_RES" | awk -Fx '{print $1}'`
INPUT_HEIGHT=`echo "$INPUT_RES" | awk -Fx '{print $2}'`
echo "File : $INFILE"
#echo "$INFO_LINE"
echo "Input : $INPUT_RES"
#that's multiply factor
FACTOR=`echo "scale = 5; $INPUT_WIDTH / $INPUT_HEIGHT" | bc`
#it's absolute value
FABS=`echo " $FACTOR > 1 " | bc`
# calculate the new size
if [ $FABS -eq "1" ]; then
WIDTH=$MAX_WIDTH
HEIGHT=`echo "scale = 0; $MAX_WIDTH / $FACTOR / 1 " | bc`
else
HEIGHT=$MAX_HEIGHT
WIDTH=`echo "scale = 0; $MAX_HEIGHT * $FACTOR / 1 " | bc`
fi
# check if width is even/or not
CHECK=`echo " $WIDTH / 2 " | bc`
CHECK=`echo " $CHECK * 2 " | bc`
if [ $CHECK -ne $WIDTH ]; then
WIDTH=$CHECK
fi
# check if height is even/or not
CHECK=`echo " $HEIGHT / 2 " | bc`
CHECK=`echo " $CHECK * 2 " | bc`
if [ $CHECK -ne $HEIGHT ]; then
HEIGHT=$CHECK
fi
# check boundaries
if [ $HEIGHT -ge $MAX_HEIGHT ]; then
HEIGHT=$MAX_HEIGHT
fi
if [ $WIDTH -ge $MAX_WIDTH ]; then
WIDTH=$MAX_WIDTH
fi
echo "Output : $WIDTH""x""$HEIGHT"
CMD1="nice -19 mencoder $INFILE -ovc $VIDEO -lavcopts vcodec=$VIDEO_CODEC:vbitrate=$VIDEO_BITRATE:vpass=1 -lameopts $LAMEOPTS"
if [ ! -z "$WANT_SCALE" ] && [ -z "$WANT_ROTATE" ]; then
CMD1="$CMD1 -vf scale=$WIDTH:$HEIGHT"
if [ ! -z "$CROP" ]; then
CMD1="$CMD1,crop=$CROP "
else
CMD="$CMD1 "
fi
fi
if [ ! -z "$WANT_ROTATE" ] && [ -z "$WANT_SCALE" ]; then
CMD1="$CMD1 -vf rotate=$ROTATE "
fi
if [ ! -z "$WANT_ROTATE" ] && [ ! -z "$WANT_SCALE" ]; then
CMD1="$CMD1 -vf scale=$WIDTH:$HEIGHT,rotate=$ROTATE "
fi
CMD1="$CMD1 -oac lavc -lavcopts acodec=$AUDIO -o $OUTFILE $SUB -subcp $SUB_ENCODING $AUDIO_RATE $ADD_EXTRA"
CMD2=`echo "$CMD1" | sed s/vpass=1/vpass=2/`
#echo $CMD1
#exit
$CMD1
$CMD2
echo "Done."
echo ""
Note: You can comment $CMD2 , as this is the second pass. Not that big difference in the size/quality, anyway.
And that's my custom mplayer i use:
[a href=\"http://z.drun.net/packages/mplayer-2in1_1.0_armv5tel.ipk]http://z.drun.net/packages/mplayer-2in1_1.0_armv5tel.ipk[/url]
It installs 3 versions of mplayer , which has different capabilities.
My /etc/mplayer/mplayer.conf:
framedrop = yes
cache = 1024
dr = yes
af=resample=44100
vo = bvdd
really-quiet = yes
font = /usr/share/mplayer/arial-36/font.desc
If the movie requires more cpu power than normal, I do it like this:
using few scripts, which can be aliases:
beware that those scripts will NOT work on non-3100/3200
cpu4 :
#!/bin/sh
echo '2000210' > /proc/zaurus/CCCR;sleep 1; echo '0a' > /proc/zaurus/VCORE; echo '416'
cpu5 :
#!/bin/sh
echo '2000214' > /proc/zaurus/CCCR;sleep 1; echo '0c' > /proc/zaurus/VCORE; echo '520'
cpu6 :
#!/bin/sh
echo '2000218' > /proc/zaurus/CCCR;sleep 1; echo '0e' > /proc/zaurus/VCORE; echo '624'
few additional scripts that help me:
mplayer_o :
#!/bin/sh
cpu5
/usr/bin/mplayer "$@"
cpu4
mplayer_oo :
#!/bin/sh
cpu6
/usr/bin/mplayer "$@"
cpu4
--------
Starting mplayer with 520 mhz:
mplayer_o /path/to/movie.avi
in 624 mhz:
mplayer_oo /path/to/movie.avi
_always_ in console. I hate to say it but doesn't work in X flawlessly. X always takes some CPU time.
that's all folks
I really watch a lot of movies like this Specially when I can't on the big screen, of course.
-
This is just what I needed, I'll give it a go with a few avi's.
Ta v much.
-
kkazakov13,
i make some changes in cpuoverclock.py and it integrated in pdaxii13 5.2+
usage:
call cpuoverclock.py wity -c options to see a list of frequencies
root-:) cpuoverclock.py -c
initializing Terminal interface
Model: SL-C3200
Freq.: 416Mhz
List: 0-104Mhz 1-208Mhz 2-312Mhz *3-416Mhz 4-520Mhz 5-624Mhz
root-:)
To Change frequence use the option -i <index of freqs>
root-:) cpuoverclock.py -c -i 5
Old Freq: 3 - 416Mhz
New Freq: 5 - 624Mhz
root-:)
you can download it here: hxxp://zaurus.servehttp.com/feed/patchs/cpuoverclockt.py
Please, let me know any bug.
-
I don't really want to execute *python* scripts to actually echo some stuff in /proc ... my scripts are fine for me , executing them from console. If they don't work on your machine, then ok, use cpuoverclock.py
-
I've not been able to run your script as I've had some trouble with my debian server and can't get mencoder to run, maybe a codec issue.. I intend to sort it when I have full gui access sometime.
Anyway, I've been using this converter for windows (http://www.erightsoft.com/SUPER.html) which is pretty damn good as it goes. I've not found any good encoding combinations that run smoothly for 640x480, so I've been encoding all my videos at 320x240
The script I use to play the vids is as follows:
mplayer -vo bvdd -fbmode qvga -ao oss -ac mad -vm -x 320 -y 240 "$*"
And the results are VERY good, I get no slowdown issues, runs smoothly because it's using the BVDD driver. Note that you cannot use the BVDD driver when xrandr resizes the screen to this resolution, so you have to do it in mplayer.
The problem with this is; when you start the script, the screen gets corrupted in a rather scary way before the video kicks in. Also when you quit playing the video, the screen remains black until it is refreshed (I switch to fullscreen in any app to restore it).
Anyone else use this method? I've been doing it quite a lot lately and doesn't seem to have damaged anything but I'd be mortified if it killed the screen....
-
Your way is setting 320x240 ... mine is 640x480. Of course for videos 320x240, in console, mplayer performance is the best.
for graphics one - i have the same problems as you, and basically prefer to go console for smoothest playback, without X involved
-
Did you try to run with my mplayer settings at 320x240? If so do you get the same graphical corruption ?
I'll give it a go without running X and see how much faster it is. Would rather not leave the desktop though.
-
I don't care much about the desktop - I prefer stability and smooth playback, without annoying crap like this. Anyway - I can't alt+tab while watching movie, so where's the difference?
-
The difference for me is that I want to be able to suspend at a moments notice and pop the Z back in my pocket. If I was not in X I would have to wait for it to load before suspending - shutting down is out of the question!!
I'm still curious if anyone gets this graphic corruption and if it's anything to worry about hardware-wise...
-
I dont' recall getting the corruption before playing but I do remember seeing it after stopping the movie. I tend to play movies without X running though. It increases speed a bit too.
if you want to suspend in non-X windows, just type:
apm --suspend
After you press enter you can close the lid with confidence that it will shut down.