×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Aug 2010
    Posts
    45

    video recording on nokia device

    i want to record video using my MIDP application. but the following code which i got from almost every forum doesn't provide me the purpose.

    Code:
    public void recordVideo()
    {
    try
    {
    //Create a Player that captures live audio.
    //Player p = Manager.createPlayer("capture://audio");
    //p.realize();
    // Get the RecordControl, set the record stream,
    // start the Player and record for 5 seconds.
    rc = (RecordControl)player.getControl("RecordControl");
    output = new ByteArrayOutputStream();
    rc.setRecordStream(output);
    rc.startRecord();
    //player.start();
    Thread.currentThread().sleep(5000);
    //rc.commit();
    //player.close();
    }
    //catch (IOException ioe) {}
    //catch (MediaException me) {}
    catch (Exception ie) { }
    }
    
    public void stopRecord()
    {
    try
    {
    System.out.println("BUFFER OUTPUT:" + output.size());
    rc.commit();
    rc.stopRecord();
    }
    catch (Exception e){}
    }
    }



    Code:
    rc=(RecordControl)player.getControl("RecordControl");
    this returns null even if the device supports video recording (checking <supports.video.capture>).

    another question: how to record sound with video in same application? does the video recording automatically records sound and incorporates with video? if not, how to do that?

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: video recording on nokia device

    Quote Originally Posted by jahid_hossain View Post
    Code:
    Player p = Manager.createPlayer("capture://audio");
    If you want to capture video, then you probably need "capture://video", not "capture://audio".

    On what device are you trying this? From where did you get the code?

    Graham.

  3. #3
    Registered User
    Join Date
    Aug 2010
    Posts
    45

    Re: video recording on nokia device

    thank you graham for your post. you are right. actually that was a writing mistake. in my code i used it properly as follows

    Code:
    Player p = Manager.createPlayer("capture://video");

    and i saw the code in almost all the forums including sun's(oracle at present) website.
    everywhere the use
    Code:
    Recordontrol rc = (RecordControl)myPlayer.getControl("RecordControl");
    . but this returns null in my nokia 6300 and 6303. both devices supports video recording.


    and please tell me how to record sound with video in same application? does the video recording automatically records sound and incorporates with video? if not, how to do that?

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: video recording on nokia device

    I don't think you can record video on these devices from a Java application. That's why you get a null - it means that RecordControl is not supported for video.

    As for video and audio... usually, the video will include audio automatically.

    Graham.

  5. #5
    Registered User
    Join Date
    Aug 2010
    Posts
    45

    Re: video recording on nokia device

    but i am able to record video using the sun wireless toolkit's sample application SnapVideo from my phone. however the video is always 6-7 seconds in length and all other parts after 6-7 second are discarded. No sound is recorded with video.

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

    Re: video recording on nokia device

    Hey Graham, on what do you base your comment about video recording not being possible on 6300 and 6303? Video recording was introduced on earlier platform revisions on Series 40 and neither of those devices is a "lite" version. I wish I still had a 6300 to test this, but I am pretty sure that device supports video recording...
    http://library.forum.nokia.com/topic...15A17823D.html

    jahid_hossain, the code examples you posted contain a commented statements and in your later comments you refer to the player with both "p" and "myPlayer" so they are definitely not from the same working/complete sample application. Have you tested with this code sample?
    http://wiki.forum.nokia.com/index.ph...deo_in_Java_ME

    Hartti

  7. #7
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: video recording on nokia device

    Quote Originally Posted by hartti View Post
    Hey Graham, on what do you base your comment about video recording not being possible on 6300 and 6303
    On a faulty recollection, apparently. You only have to remember the specs of the Nokias... I have to remember the specs (and quirks) of the Nokias, Sony Ericssons, Motorolas, Samsungs, LGs, Sagems, ... Unfortunately, it's not documented anywhere that I know. Just because a device can record video, doesn't mean it will record video in Java. But hence the qualification "I don't think..." rather than "you can't...".

    Quote Originally Posted by jahid_hossain View Post
    but i am able to record video using the sun wireless toolkit's sample application SnapVideo from my phone. however the video is always 6-7 seconds in length and all other parts after 6-7 second are discarded. No sound is recorded with video.
    I'd suggest you go back to the code that works, and start from there.

    Graham.

  8. #8
    Registered User
    Join Date
    Aug 2010
    Posts
    45

    Re: video recording on nokia device

    thank you harti for your post. i tried with the code sample you given. when i start the code, it shows a black screen. when i hit start button, it says "Application access set to not allowed". how to resolve the case so that i can test the application in my mobile?

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

    Re: video recording on nokia device

    Quote Originally Posted by grahamhughes View Post
    On a faulty recollection, apparently. You only have to remember the specs of the Nokias... I have to remember the specs (and quirks) of the Nokias, Sony Ericssons, Motorolas, Samsungs, LGs, Sagems, ...
    I hear you :-)

    H

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

    Re: video recording on nokia device

    Oh, man. I guess you are working on a operator-branded phone.... Are you? T-Mobile US? AT&T? Some other operator? If yes, which one?

    This seems to be related to Java ME Security Domains. Your MIDlets do not have full, unrestricted access to a number of APIs.. Read this for starters
    http://wiki.forum.nokia.com/index.ph...curity_Domains

    H

  11. #11
    Registered User
    Join Date
    Aug 2010
    Posts
    45

    Re: video recording on nokia device

    hi hartti...i guess you are wrong. i am not using a operator branded phone. and as i said you before, i am able to use sun wireless toolkit's video recording code sample which only record video for 6second. but the code sample you have given isn't working.

Similar Threads

  1. Nokia 6555 video recording
    By vijaypatidar in forum Mobile Java Media (Graphics & Sounds)
    Replies: 12
    Last Post: 2008-08-22, 16:55
  2. Video recording problem on Nokia N93
    By strutv in forum Streaming and Video
    Replies: 0
    Last Post: 2007-05-21, 13:24
  3. NOKIA 3250 video recording problem
    By dubey_hbti27 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2007-01-10, 22:25
  4. Nokia 6280 video Recording.
    By soku123 in forum General Development Questions
    Replies: 0
    Last Post: 2006-04-25, 15:04
  5. Video recording with nokia 3200
    By kennedytham in forum General Development Questions
    Replies: 0
    Last Post: 2004-03-09, 14:07

Posting Permissions

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