×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    7

    Nokia 6280 Problems Capture Video and Locator...

    Hello,
    i'm new in J2ME and i'm trying to capture-video and take a photogram to convert it a Image.

    I have this code and with Wireless Tool Kit run but with Nokia 6280 doesn't run and show this Exception: javax.microedition.media.MediaException: Only capture://image locator supports getSnapshot()

    and this is the relevant code:

    private void showCamera() {
    try {
    mPlayer = Manager.createPlayer("capture://video");
    mPlayer.realize();

    mVideoControl = (VideoControl)mPlayer.getControl("VideoControl");

    Canvas canvas = new CameraCanvas(this, mVideoControl);
    canvas.addCommand(mBackCommand);
    canvas.addCommand(mCaptureCommand);
    canvas.setCommandListener(this);
    mDisplay.setCurrent(canvas);

    mPlayer.start();
    }
    catch (IOException ioe) { handleException(ioe); }
    catch (MediaException me) { handleException(me); }
    }

    public void capture() {
    try {
    // Get the image.
    byte[] raw = mVideoControl.getSnapshot("encoding=jpeg");
    Image image = Image.createImage(raw, 0, raw.length);

    Image thumb = createThumbnail(image);

    // Place it in the main form.
    if (mMainForm.size() > 0 && mMainForm.get(0) instanceof StringItem)
    mMainForm.delete(0);
    mMainForm.append(thumb);

    // Flip back to the main form.
    mDisplay.setCurrent(mMainForm);

    // Shut down the player.
    mPlayer.close();
    mPlayer = null;
    mVideoControl = null;
    }
    catch (MediaException me) { handleException(me); }
    }

    thank's for your informtion!!

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

    Re: Nokia 6280 Problems Capture Video and Locator...

    Have you tried with the suggested "capture://image" locator?

    Pit

  3. #3
    Registered User
    Join Date
    May 2008
    Posts
    7

    Re: Nokia 6280 Problems Capture Video and Locator...

    ...i wanna get the video...

  4. #4
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

    Re: Nokia 6280 Problems Capture Video and Locator...

    As from this forum thread:

    http://discussion.forum.nokia.com/fo...ad.php?t=99650

    On S40 you should youse "capture://video" locator if you want to record video, and "capture://image" if you want to capture an image from camera, as you're trying to do with the getSnapshot() method.

    Pit

  5. #5
    Registered User
    Join Date
    May 2008
    Posts
    7

    Re: Nokia 6280 Problems Capture Video and Locator...

    First all, thanks...but i try the MobileVideoIP.jar and i have the same problem with snapshot... 'Only capture://image supports getSnapshot()'... i will try with image...

  6. #6
    Registered User
    Join Date
    May 2008
    Posts
    7

    Re: Nokia 6280 Problems Capture Video and Locator...

    I try to do some think like this with a Nokia 6280:

    https://cis.med.ucalgary.ca/http/jav...t2#scenario-11
    Please help!
    Thanks in advanced!

  7. #7
    Nokia Developer Champion
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,192

    Re: Nokia 6280 Problems Capture Video and Locator...

    rodperez, please read jappit's answer above. for snapshots you need to use image, for video you need to use video.

    Hartti

  8. #8
    Registered User
    Join Date
    May 2008
    Posts
    7

    Re: Nokia 6280 Problems Capture Video and Locator...

    Thanks...but thats mean i cant take a frame from video, i cant run with nokia 6280 http://mobilevideoip.sourceforge.net/???
    now i'm trying with s60 becouse i think my program doesnt work with s40 but works with s60. I need take a frame from video!!
    thanks another time!

  9. #9
    Nokia Developer Expert
    Join Date
    May 2007
    Location
    Mexico D.F
    Posts
    351

    Re: Nokia 6280 Problems Capture Video and Locator...

    Hello rodperez

    1. You need to use the locator "capture://image" ... altough it says image, you will be presented with the current video view of the camera.

    2. The problem here seems to be the encoding... wireless toolkit shows you an encoding like this one: "encoding=jpeg"

    For S40 3rd Edition you can try this one: "enconding=image/jpg"

    Anyway... you can know the allowed encodings by making a very simple midlet, run it and display the encodings

    ----
    String s = System.getProperty("video.snapshot.encodings");
    Form f=new Form("codificacion");
    f.append(s);
    Display.getDisplay(this).setCurrent(f);
    ----

    Try that...

  10. #10
    Registered User
    Join Date
    May 2008
    Posts
    7

    Re: Nokia 6280 Problems Capture Video and Locator...

    Thanks another time... i have try that, but how can i display the video with capture://image...when the locator is capture://image the aplication cant display the video...and i need it!!
    thanks

  11. #11
    Nokia Developer Expert
    Join Date
    May 2007
    Location
    Mexico D.F
    Posts
    351

    Re: Nokia 6280 Problems Capture Video and Locator...

    Hello rodperez

    As long as you don't need to record any video you can use capture://image . This will show you a screen with the current video provided with the camera...

    Now I see why you don't see anything... you forgot to use the following line... (very important)

    mVideoControl.setVisible(true);

    You need to do that... otherwise you won't see anything.

    Check it up!

Similar Threads

  1. MediaException N93
    By Lichtens in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2007-04-23, 20:05
  2. Locator for Capture on 6680 - MMAPI
    By metebalci in forum Mobile Java Media (Graphics & Sounds)
    Replies: 30
    Last Post: 2006-08-14, 23:06
  3. Nokia 6230i - midlet video capture?
    By nvulin in forum Streaming and Video
    Replies: 2
    Last Post: 2006-01-17, 10:42
  4. Video Capture on 6630
    By vanevery in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2005-06-10, 16:06

Posting Permissions

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