×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    7

    getSnapshot too slow on N95

    My MIDLet calls videoControl.getSnapshot(null) to capture photo. On Nokia N95, it takes almost 2-3 seconds for getSnapshot to return. Is there any way to speed it up?

  2. #2
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: getSnapshot too slow on N95

    If you take a photo with the Camera application on N95, also that has some shutter lag. I think there is nothing you can do to speed that up. (hopefully I am wrong...)

    Hartti

  3. #3
    Registered User
    Join Date
    Aug 2007
    Posts
    14

    Re: getSnapshot too slow on N95

    you can try bmp encoding

  4. #4
    Regular Contributor
    Join Date
    Apr 2005
    Posts
    75

    Re: getSnapshot too slow on N95

    Hi,

    I have the same problem on my N95.
    In my application it takes even longer: ~ 5 seconds.
    It does not matter which extension (bmp, png, jpeg) or resolution I use. In practice I want to use a png with 160x120 pixels (videoControl.getSnapshot("encoding=png&width=160&height=120"))
    that should be created much faster. I suppose the camera captures a full resolution image and down samples it to the given size.
    Has anyone an idea how to capture a small image in an appropriate time?

    Thanks,

    Kurt

  5. #5
    Regular Contributor
    Join Date
    Oct 2003
    Posts
    62

    Re: getSnapshot too slow on N95

    5 seconds for a low-resolution shapshot on the N95!? Amazing.
    My app is designed to take 64 x 64 pixel snapshots once per
    second, and it will currently time out after 4 seconds. This
    could explain why it reportedly does not run on the Nokia N95.
    It looks like Nokia did not take care of the fact that some
    vision applications do not need megapixels but rather need
    a decent capture rate. Is there a workaround for the N95 to
    lower its capture time for low resolution snapshots, or can
    we only hope that the next firmware upgrade will correct this?

    Thanks,

    Peter Meijer


    The vOICe for Mobile Camera Phone and PDA
    http://www.seeingwithsound.com/midlet.htm

  6. #6
    Registered User
    Join Date
    Dec 2007
    Posts
    26

    Re: getSnapshot too slow on N95

    Pardon me if this is too simple a workaround, but couldn't you use either the viewfinder images, or capture as video, and get your low rez, high capture rate images from there ?

    Just decimate the stream down to whatever fps you need ?

  7. #7
    Regular Contributor
    Join Date
    Oct 2003
    Posts
    62

    Re: getSnapshot too slow on N95

    Thanks.

    I'm afraid that the video streaming approach will not work for getting
    individual low resolution frames at the required split second latency,
    but I'll gladly be proven wrong! I have not tried on-the-fly extraction
    of video frames from a live video stream from the camera. Did anyone
    have success with that angle of attack?

    Quote Originally Posted by bobjandal View Post
    Pardon me if this is too simple a workaround, but couldn't you use either the viewfinder images, or capture as video, and get your low rez, high capture rate images from there ?

    Just decimate the stream down to whatever fps you need ?

  8. #8
    Registered User
    Join Date
    Dec 2007
    Posts
    26

    Re: getSnapshot too slow on N95

    you can get out the individual images from the viewfinder, and the video stream, if you use C++ - not sure if its possible in java, sorry. Be nice if it was ! but the application i'm into also needs more fine grained control of other aspects, like autofocus, etc, which is only available in C++ at this stage.

    Should be able to use jni to load up a custom C++ module that does what you want ? or doesn't jni work in symbian.... ?

  9. #9
    Regular Contributor
    Join Date
    Oct 2003
    Posts
    62

    Re: getSnapshot too slow on N95

    There is no JNI-like interface in Java on Nokia phones, so we are
    stuck with any limitations in the Java implementation for a given
    phone, including for instance the inability to mute the shutter
    sound even while AMMS has a function for that very purpose. AFAIK,
    one also cannot capture the viewfinder image in Java. :-(

    Quote Originally Posted by bobjandal View Post
    you can get out the individual images from the viewfinder, and the video stream, if you use C++ - not sure if its possible in java, sorry. Be nice if it was ! but the application i'm into also needs more fine grained control of other aspects, like autofocus, etc, which is only available in C++ at this stage.

    Should be able to use jni to load up a custom C++ module that does what you want ? or doesn't jni work in symbian.... ?

  10. #10
    Regular Contributor
    Join Date
    Apr 2005
    Posts
    75

    Re: getSnapshot too slow on N95

    Hi,

    for extracting images from the viewfinder (screenshot) in J2ME you can use the Nokia Prototype SDK 4.0. It offers a "DirectGraphics" class with a method "getPixels()" that you can use for screen capture.
    Of course, this works only on Nokia phones.

    Kurt

  11. #11
    Regular Contributor
    Join Date
    Oct 2003
    Posts
    62

    Re: getSnapshot too slow on N95

    Thank you Kurt for the good suggestion. My MIDlet is also being used
    on Sony Ericsson and Motorola phones, so I'd prefer to avoid a further
    code fragmentation if it can at all be avoided. Just today I got the
    confirmation from a blind N95 user in Germany that relaxing my
    4-second timeout in a not-yet-released test version for the N95 does
    seem to get my MIDlet working again on the Nokia N95, although it will
    still be painfully slow of course.

    Peter


    The vOICe for Mobile Camera Phone and PDA
    http://www.seeingwithsound.com/midlet.htm

    Quote Originally Posted by Kurt Johannes View Post
    Hi,

    for extracting images from the viewfinder (screenshot) in J2ME you can use the Nokia Prototype SDK 4.0. It offers a "DirectGraphics" class with a method "getPixels()" that you can use for screen capture.
    Of course, this works only on Nokia phones.

    Kurt

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

    Re: getSnapshot too slow on N95

    Viewfinder frames are as fast as 30 per second, and I manage to get 10 fps on 640x480 resolution images and a decent amount of object recognition code for each frame. So if you don't need auto focus use view finder by enabling

    StartViewFinderBitmapsL(size)

    and picking up the frame's bitmap in whatever controller function is called by ViewFinderFrameReady(). BTW, on N95 frames will be in RGBA format (in Symbian terminology FormatFbsBitmapColor16MU). Thus it is easy to memcpy them to bitmap or integer array keeping in mind that there are 4 bytes per pixel:

    memcpy (Des, Src, h1*w1*byte_per_pixel);

    Don't forget to lock the heap during direct access to a bitmap!

    Some useful reference links:

    Real_time video:
    http://www.newlc.com/optimization-re...n95-smartphone

    Still images of high resolution:
    In order to use high quality visual features (e.g. for text recognition) one should use image capture as opposed to video or view finder frames. The reasons for that is a possibility for better focus, higher resolution, using flash and advanced image processing features available.

    Before one initializes Image Capture in PowerOnComplete() function a proper combination of format and size index should be known. Below is the table with accessible frame formats and resolutions for Nokia N95 phone (see CCamera class).
    Table 1. Formats and resolution for frames in still image mode on Nokia N95. The data in the table correspond to the size index (see code below)
    Format/ Resolution 2592x1944 2048x1536 1600x1200 1024x768 640x480

    EFormatExif (JPEG) 0 1 2 3 4

    EFormatFbsBitmapColor4K,
    EFormatFbsBitmapColor64K,
    EFormatFbsBitmapColor16M - - - 3 4
    frame finder is in EFormatFbsBitmapColor16MU

    The code below checks a combination of format with sizes:

    // pick up a format you are interested in
    CCamera::TFormat format = CCamera::EFormatFbsBitmapColor16M;

    // get information about the camera
    TCameraInfo aInfo;
    iCamera->CameraInfo(aInfo);
    TInt cc = aInfo.iNumImageSizesSupported;
    TSize size[6];

    // all non-zero sizes returned are supported for a
    // specified format
    for (TInt i=0;i<cc;i++)
    {
    iCamera->EnumerateCaptureSizes(size[i], i, format);
    }

    // now to use the format/size, say, 16M/1024x768 call
    TRAPD(err, iCamera->PrepareImageCaptureL(CCamera::EFormatFbsBitmapColor16M, 3));

  13. #13
    Regular Contributor
    Join Date
    Oct 2003
    Posts
    62

    Re: getSnapshot too slow on N95

    Thank you vivanchenko. However, this is the Mobile Java forum, and I'm
    afraid that there is no portable equivalent of your C code in Java. I
    can only hope that Nokia pays some more attention to key inefficiencies
    in their latest Java engines for live media processing.

    Let me remind Nokia of their March 22, 2007 press release, reading

    > "The Nokia N95 is the ultimate multimedia computer and a fantastic
    > example of what Nokia Nseries devices can deliver," said Juha Putkiranta,
    > senior vice president, Multimedia, Nokia.

    (Source: http://www.nokia.com/A4136001?newsid=1113533 )

    So here I am, trying to convert live low-res video to live audio, but
    getting stuck with N95's at most one 64 x 64 pixel snapshot every five
    seconds or so when using standard Mobile Java Media!? That is making a
    joke of the press release.

    Is there a relevant N95 firmware upgrade in the pipeline? I have no plans
    to write brand-specific mobile phone software anytime soon, because my
    user base is quite scattered in terms of brands and types of phones they
    use.

    Regards,

    Peter


    The vOICe for Mobile Camera Phone and PDA
    http://www.seeingwithsound.com/midlet.htm

  14. #14
    Registered User
    Join Date
    May 2008
    Posts
    1

    Re: getSnapshot too slow on N95

    I had a simmilar problem on the SEK800i and I was able to improve the speed with the amms(jsr234) facilities. I don't know what effect would this have on the N95.

    Does anyone know a phone that captures pictures with the VideoControl.getSnapshot method faster than the Nokia6600? I'm not interested in the quality of the snapshot, or the size, or encoding - just the capture speed. The Nokia6600 takes a bmp snapshot in the default size in about 0,2 - 0,3 seconds.

    Thanks,
    Ovidiu.

  15. #15
    Super Contributor
    Join Date
    Feb 2006
    Posts
    689

    Re: getSnapshot too slow on N95

    Hi,
    A software update in ur phone may make it faster.U can do it from the nokia site.
    Thanks
    Soku

Similar Threads

  1. jsr234 camera getSnapShot() on Nokia N95
    By garyjamessilva in forum Mobile Java Media (Graphics & Sounds)
    Replies: 21
    Last Post: 2008-07-02, 15:14
  2. getSnapshot() slow on Nokia 6600
    By meijerpb in forum Mobile Java General
    Replies: 10
    Last Post: 2008-01-14, 08:28
  3. Issue with slow date operations on N95
    By redsmurph in forum Mobile Java General
    Replies: 8
    Last Post: 2007-12-24, 17:15
  4. jsr135 highest supported camera resolutions for getSnapShot() on N95
    By garyjamessilva in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2007-05-30, 21:14
  5. getSnapshot is very slow?
    By diluo in forum Mobile Java General
    Replies: 0
    Last Post: 2005-10-28, 11:28

Posting Permissions

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