×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 20

Thread: Nokia 6233/6234

  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    12

    Nokia 6233/6234 J2ME videoplayer with "seeking"

    I have released a J2ME video player for Nokia 6233/6234 which basically offers some kind of workaround for the video player (i.e. no seeking).

    Note to mods: if this is not the proper place for this, feel free to moderate.

    You can find it at http://eucaliptus.ath.cx/~alex/nokia-vid-player/ (freshmeat.net release soon at http://freshmeat.net/projects/nokia-vid-player/ ).

    I quote the README:

    vid player 0.1 - koalillo-at-fastmail-fm January 26th, 2007

    INTRODUCTION

    vid player is a J2ME Java application designed for the Nokia 6233/6234 mobile phones that
    attempts to fix video playback issues.

    The Nokia 6233/6234 default firmware does not allow seeking within videos. If you split
    videos in smaller chunks, you find that you cannot play them back in sequence comfortably.

    vid player plays continuously files in a folder (with a noticeable but tolerable
    gap), fullscreen and turning off the screen blanker. It also provides key combinations to
    change the volume, play/pause, jump to the previous/next video in a folder
    and jump to the previous/next folder.

    VIDEO PREPARATION

    I have found the following script to be useful for preparing videos for the program:

    --------------
    #!/bin/sh

    IN="$1"
    CHUNK_LENGTH=$2

    LENGTH_MS=$(extract "$1" | grep "ms$" | sed "s/^.* \([0123456789]*\) ms$/\1/")
    CHUNKS=$(( ($LENGTH_MS + $CHUNK_LENGTH*1000 - 1) / ( $CHUNK_LENGTH * 1000 ) ))

    echo Video is $LENGTH_MS ms long
    echo Need $CHUNKS chunks of $2 seconds

    mencoder "$IN" -vf scale=320:-11,rotate=1 -oac mp3lame -af volnorm=1:1 -ovc lavc -o tmp.avi

    for (( CHUNK=0 ; CHUNK<$CHUNKS ; CHUNK=CHUNK+1 ))
    do
    CHUNK_NAME=0000000$CHUNK

    ffmpeg -i tmp.avi -b 150 -ss $(( $CHUNK*$CHUNK_LENGTH )) -t $CHUNK_LENGTH -y -r 15 vid-${CHUNK_NAME: -4}.mp4
    done
    -------------

    Usage is: script <source video> <chunk length in seconds>

    This script uses ffmpeg and mencoder to split the source video in fixed-length chunks and encode it
    into a 240x320 rotated MPEG4 file, normalizing the volume. It puts the chunks in the current folder,
    with vid-0000.mp4 names, and a tmp.avi file which is an intermediate version

    The player is hardcoded to look in the device's MicroSD like this:

    * MicroSD card (E
    * E:\video
    * E:\video\<video1>
    * E:\video\<video1>\<video1-file1>, ..., E:\video\<video1>\<video1-filen>
    * E:\video\<video2>
    * E:\video\<video2>\<video2-file1>, ..., E:\video\<video2>\<video2-filem>

    PLAYER USAGE

    You have to copy the vid.jar and vid.jad files somewhere in the mobile's memory. There, you should
    give access rights to the application:

    * Select the "vid Midlet Suite" entry in "My Items" folder
    * Choose "Options"
    * Choose "Application Access"
    * Choose "Data access"
    * Choose "Add and edit data"
    * Choose "Ask Every Time"

    After this, open the application. It should ask for access rights a few times (once for each
    video folder) and start playing the first video. You can use the phone's keys to control the application:

    RMB HUP 3 6 9 #
    UP
    LEFT FIRE RIGHT 2 5 8 0
    DOWN
    LMB CALL 1 4 7 *

    The following functionality is available:

    * HUP: Quit
    * UP/DOWN: previous/next folder
    * LEFT/RIGHT: previous/next video (rewind/fast-forward)
    * FIRE: play/pause
    * 1-9: jump to 0%..100% in folder
    * #: maximum volume
    * 0: increase volume
    * *: decrease volume

    LICENSE

    This software and the associated documentation is in the PUBLIC DOMAIN.

    I make no guarantees about the software's behaviour and performance. If
    it kills your dog and eats your homework, I'm sorry. It probably contains
    horrendous bugs and can hang or otherwise hurt your mobile phone, I
    will accept no responsabilities for anything caused by this software.

    SOURCE CODE

    The source code is also an Eclipse project which can be compiled using
    EclipseME (I'm using Eclipse 3.3M4 and EclipseME 1.6.2). You also need
    the classes.zip distributed in the Nokia S40 Java SDK (Series 40 Platform SDKs?).

    You also need a wireless toolkit (I'm using WTK2.2 from Sun)

    You should be able to import the project in your workspace. You should
    be able to regenerate the jad/jar files by right-clicking in the project
    and selecting J2ME -> Create Package.

    CONTACT INFO

    I can be reached at koalillo-at-fastmail-dot-fm. Although this software is
    PUBLIC DOMAIN, I'd appreciate any contribution if you find this software useful,
    or intend to use it comercially. Feedback, patches and requests are appreciated.

    I have written this for my own use, annoyed by the poor video playback capabilities
    of the Nokia 6234. In case someone from Nokia reads this, this phone is pretty much
    excellent, however there's improvable stuff:

    * Proper video playback without hacks like this
    * Voice control of the audio player
    * Better control of the audio player through the hands-free (at least play/pause)
    * A2DP support
    * SDK support in Linux (development is pretty slow, as I don't have an emulator
    that plays video like the phone)

    I also have no clue about J2ME, so probably I'm doing things in a wrong and
    terrible way.

    TODO

    * Improve video change gap
    * Improve video preparation script
    * Nicer interface
    * Speed up encoding (each ffmpeg operation has to skip to the bit of video it wants to encode and it's a bit slow)
    * Windows version
    * Better error handling
    * On-screen display
    * Menu for choosing among the folders
    * Configurable video location
    * J2ME signing (or whatever is required to minimize the security questions)

    LINKS

    * http://www.mplayerhq.hu/ - Mplayer and Mencoder homepage
    * http://ffmpeg.mplayerhq.hu/
    * http://www.eclipse.org/
    * http://www.eclipseme.org/
    * http://www.forum.nokia.com/
    * http://java.sun.com/products/sjwtoolkit/
    Last edited by koala; 2007-01-26 at 23:12. Reason: title fix

  2. #2
    Registered User
    Join Date
    Jan 2007
    Posts
    4

    Re: Nokia 6233/6234 J2ME videoplayer with "seeking"

    Its good that finally someone 'wrote' a video player with ff/rew functions.

    But i have one question. This will be only on Nokia 6233/6234 ?
    If yes, i will be very sad becouse im using a 6280 model and i need damn player with ff/rew

    Good Job.
    Regards.

  3. #3
    Registered User
    Join Date
    Oct 2006
    Posts
    12

    Re: Nokia 6233/6234

    Well, unfortunately I don't have a 6280 to test. I have a feeling that the hardware is very similar, so it *might* work- but probably it doesn't.

    I suppose that someone with some J2ME skills could adapt my code, though. The source is available if someone wants to try.

  4. #4
    Registered User
    Join Date
    Jan 2007
    Posts
    4

    Re: Nokia 6233/6234

    Yes unfortunately it doesnt...
    "Security java/land/SecurityException Acces Denied"

    Shame

  5. #5
    Registered User
    Join Date
    Oct 2006
    Posts
    12

    Re: Nokia 6233/6234

    Well, the application needs to read your MicroSD card, and to do that you have to give it permissions (although you shouldn't trust random jad/jars you get over the internet).

    Check the instructions. You also have to convert the videos to mp4, 240x320, etc.

  6. #6
    Registered User
    Join Date
    Jan 2007
    Posts
    4

    Re: Nokia 6233/6234

    Ok. I give it permissions, and its looking that aplication is working but when he ask about second permission "Allow application to edit and add new data in: Memory Card" (I give 'yes') after giving a permission i dont see movie but "%U running. Nothing to display" and thats all.

    Movie is compresed in .mp4.

    Have some ideas ?

  7. #7
    Registered User
    Join Date
    Oct 2006
    Posts
    12

    Re: Nokia 6233/6234

    Check out the README and see if you have followed the instructions to preparing the video, particularly, the folder structure. Encoding the videos correctly is a little bit tricky right now, too.

  8. #8
    Registered User
    Join Date
    Oct 2006
    Posts
    1

    Re: Nokia 6233/6234

    Hi,
    I've installed the player on my 6233, but I cannot get it to play any videos, and I don't know if it is a problem with the video-directory name (so it can't find any files to play) or the video-file itself.
    I get the following message "96U körs. Det finns ingenting att visa."

    The video is being played by the phones normal video-player, but I need to switch to Full Screen. It is encoded in 320-240 and mp4.
    I have used both SUPER and CloneDVDMobile to create video-files and the phone plays videos from both applications. I have not used mencoder/ffmpeg.

    Would you be able to give some more explanations on the directory structure that the player is expecting? Maybe some examples could help.

    Also, what encoding options does the player expect? You state that the script rotates the video to 240-320, but is the player actually expecting that format? What if I have a normal file in 320-240?

    The concept is really good, but no use to me if I cannot get it to play any videos...

  9. #9
    Registered User
    Join Date
    Oct 2006
    Posts
    12

    Re: Nokia 6233/6234

    Hi,

    Thanks for trying it out.

    Would you be able to give some more explanations on the directory structure that the player is expecting? Maybe some examples could help.
    Yes, from the documentation:

    The player is hardcoded to look in the device's MicroSD like this:

    * MicroSD card (E
    * E:\video
    * E:\video\<video1>
    * E:\video\<video1>\<video1-file1>, ..., E:\video\<video1>\<video1-filen>
    * E:\video\<video2>
    * E:\video\<video2>\<video2-file1>, ..., E:\video\<video2>\<video2-filem>
    Yes, at the moment, the player expects the videos to be 240x320, already rotated- I know this is far from ideal, but it makes the program simpler. If I got some time, I would whip up a quick frontend for mencoder/ffmpeg that encodes videos properly, but sadly I don't think I'll be able to do that soon.

    This is something I made up quickly for myself, I'm publishing it hoping that it's useful to someone, or that someone can improve on it and release something more complete.

    Regards,

    Alex

  10. #10
    Registered User
    Join Date
    Apr 2007
    Posts
    4

    Re: Nokia 6233/6234

    Hi koala
    I am tying to use your script for encoding video and have some issues. Could you please help me?

    I have:
    * test.avi - file to be converted
    * videoed.sh - your script
    both on the same location

    When I execute the script I have the following:

    ------------------------------------------------------------------

    [root@localhost test]# ./videoed.sh test.avi 5
    ./videoed.sh: line 6: extract: command not found
    Video is ms long
    Need 0 chunks of 5 seconds
    MEncoder 1.0pre8-4.1.1 (C) 2000-2006 MPlayer Team
    CPU: Intel(R) Pentium(R) 4 CPU 2.60GHz (Family: 15, Model: 2, Stepping: 9)
    CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
    Compiled with runtime CPU detection.
    93 audio & 211 video codecs
    MPlayer was compiled without libmp3lame support.
    [root@localhost test]#

    ------------------------------------------------------------------
    I am a beginner in linux so I am not sofamiliarized with .sh scripts.

    Thank you in advance

    Vadim

    PS. I am using Mandriva Power Pack 2007 distribution

  11. #11
    Registered User
    Join Date
    Oct 2006
    Posts
    12

    Re: Nokia 6233/6234

    Hi,

    Thanks for trying it out. I use a program called extract to calculate the length of the supplied video file. You need to have it installed to execute the script correctly. You can find the software at http://www.gnunet.org/libextractor/ . I do not know Mandriva, but for instance, in Debian it is packaged as "extract".

    Let me know if you need something else.

    Alex

  12. #12
    Registered User
    Join Date
    Apr 2007
    Posts
    4

    Re: Nokia 6233/6234

    Hi Alex.
    Thanks for lib extractor now I have the following issue:

    -------------------------------------------------------------------------------------
    FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
    configuration:
    libavutil version: 49.4.0
    libavcodec version: 51.40.2
    libavformat version: 51.11.0
    built on Apr 4 2007 21:51:03, gcc: 4.1.1 20060724 (prerelease) (4.1.1-3mdk)
    tmp.avi: I/O error occured
    Usually that means that input file is truncated and/or corrupted.

    --------------------------------------------------------------------------------------

    Could U help me pls?

    Thanks

  13. #13
    Registered User
    Join Date
    Oct 2006
    Posts
    12

    Re: Nokia 6233/6234

    Isn't there an earlier error? Sounds like mencoder is not generating tmp.avi and thus ffmpeg fails.

    Do you have mencoder installed (it probably is in an mplayer package)?

  14. #14
    Registered User
    Join Date
    Apr 2007
    Posts
    4

    Re: Nokia 6233/6234

    Hi Alex
    Thanks for feedback.
    I have the mencoder installed. It come with mplayer.

    But I found something interesting. When I change the command ¨mp3lame¨ with ¨copy¨ from the script the file is converting normally. It seems that mp3 encoder does not working.

    in the config.log file from mplayer I found the following:

    ============ Checking for libmp3lame (for mencoder) ============

    #include <lame/lame.h>
    int main(void) { lame_version_t lv; (void) lame_init(); get_lame_version_numerical(&lv); printf("%d%d\n",lv.major,lv.minor); return 0; }

    cc -O4 -march=pentium4 -mtune=pentium4 -pipe -ffast-math -fomit-frame-pointer -o /root/tmp/mplayer-conf-22152-7207.o /root/tmp/mplayer-conf-14820-7207.c -lmp3lame -lm
    /root/tmp/mplayer-conf-14820-7207.c:1:23: error: lame/lame.h: No such file or directory
    /root/tmp/mplayer-conf-14820-7207.c: In function 'main':
    /root/tmp/mplayer-conf-14820-7207.c:2: error: 'lame_version_t' undeclared (first use in this function)
    /root/tmp/mplayer-conf-14820-7207.c:2: error: (Each undeclared identifier is reported only once
    /root/tmp/mplayer-conf-14820-7207.c:2: error: for each function it appears in.)
    /root/tmp/mplayer-conf-14820-7207.c:2: error: expected ';' before 'lv'
    /root/tmp/mplayer-conf-14820-7207.c:2: error: 'lv' undeclared (first use in this function)
    /root/tmp/mplayer-conf-14820-7207.c:2: warning: incompatible implicit declaration of built-in function 'printf'

    ldd /root/tmp/mplayer-conf-22152-7207.o
    ldd: /root/tmp/mplayer-conf-22152-7207.o: No such file or directory

    Result is: no
    ##########################################

    Do you know a workaround for this issue?

    Thanks

    BR
    Vadim

  15. #15
    Registered User
    Join Date
    Apr 2007
    Posts
    4

    Re: Nokia 6233/6234

    If I let the audio format as it is, I mean ¨copy¨ than at the splitting step I get the following for each part of file:

    ##################################################################
    Seems stream 0 codec frame rate differs from container frame rate: 1199.00 (1199/1) -> 23.98 (24000/1001)
    Input #0, avi, from 'tmp.avi':
    Duration: 00:03:55.5, start: 0.000000, bitrate: 881 kb/s
    Stream #0.0: Video: mpeg4, yuv420p, 176x320, 23.98 fps(r)
    Stream #0.1: Audio: mp3, 48000 Hz, stereo, 96 kb/s
    Output #0, mp4, to 'vid-0097.mp4':
    Stream #0.0: Video: mpeg4, yuv420p, 176x320, q=2-31, 0 kb/s, 15.00 fps(c)
    Stream #0.1: Audio: 0x0000, 48000 Hz, stereo, 64 kb/s
    Stream mapping:
    Stream #0.0 -> #0.0
    Stream #0.1 -> #0.1
    Unsupported codec for output stream #0.1

    ###################################################################

    Alex I am realy interested and want to use your knowhow )))
    Sory if I bother you.

    All sugesstions will be greathful.

    Thanks

    BR
    Vadim

Similar Threads

  1. Replies: 2
    Last Post: 2008-04-03, 19:02
  2. Infra-red capability
    By Symbian_Challenge_0412 in forum General Development Questions
    Replies: 1
    Last Post: 2005-08-16, 18:24
  3. Nokia Mobile VPN Client
    By marcyl in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2003-12-01, 14:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×