symbian

J2ME functions that aren't included - but should be

Because J2ME is annoying, it doesn't have a function that rounds a number, say 1234.56789 to a certain number of decimal places. So here is mine.

PS. I am learning Java, so if it doesn't adhere to the One True Java Way (tm), please feel free to write me a long, vitriolic diatribe criticising me and delete it before sending. Otherwise, leave a comment telling me where I went wrong.


public static double calumround(double arg, int places) {
double tmp = (double) arg * (pow(10,places));
int tmp1 = (int)Math.floor( tmp + 0.5 );

Encoding with ffmpeg for the Nokia N80

This is the script I use to convert rips, youtube vids, or whatever so that I can watch them in Real Player on my Nokia N80 at a later time.

I put it here, so that people searching might find the answer more easily.

Obviously, you'll need ffmpeg installed.

USE="a52 aac amr encode imlib mmx network ogg sdl theora truetype v4l vorbis x264 xvid zlib" emerge -v ffmpeg

This uses 24 fps @ 350kb/s mpeg4 video, and 32kb/s 16kHz AAC mono audio. You can tweak as you like.

if [[ ! -f "$1" ]]
then
echo $1 doesnt exist
exit
fi
ffmpeg -i "$1" -ar 16000 -ac 1 -acodec aac -vcodec mpeg4 -s 352x288 -r 24 -b 350 -ab 32 "$1.3gp"
  
Syndicate content