This discussion is archived
0 Replies Latest reply: Jun 30, 2013 2:10 PM by fc8e7ae3-56b6-4b07-926f-730a2fbb293d RSS

recording video with camera in j2me???

fc8e7ae3-56b6-4b07-926f-730a2fbb293d Newbie
Currently Being Moderated

Hi !

I'm just a beginner in J2ME . I want to make a simple application which record video using my PC's webcam and then play it in the Emulator when I click the play command. I have tried much, but when I click on record command , instead of showing the video stream it just displays colourful moving waves just like rgb888 video format. Is there any way to show the video which is being record from camera???

Here is the code for starting recording!!! I need Urgent "Help" ...!!!

 

public void startRecording() {

            try {

                player = Manager.createPlayer("capture://video");

  player.addPlayerListener(this);

  player.realize();

 

                //setup recording

  record = (RecordControl)player.getControl("RecordControl");

  // record.setRecordSizeLimit(300000);

  conn = (FileConnection)Connector.open(PATH,Connector.READ_WRITE);

  if(!conn.exists()) conn.create();

  stream = conn.openOutputStream();

  record.setRecordStream(stream);

 

  // Grab the video control and set it to the current display.

  control = (VideoControl)player.getControl("VideoControl");

  if (control != null) {

                    control.initDisplayMode(VideoControl.USE_DIRECT_VIDEO,this);

                    control.setDisplaySize(getWidth(),getHeight());

     control.setVisible(true);

                }

 

                player.start();

                record.startRecord();

            }

            catch(Exception e) {

                Alert erro = new Alert("Erro",e.toString(),null,AlertType.ERROR);

                Display.getDisplay(midlet).setCurrent(erro);

                e.printStackTrace();

            }

  }

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points