×

Discussion Board

Results 1 to 1 of 1
  1. #1
    Registered User
    Join Date
    Dec 2009
    Posts
    38

    how to increase the resolution of the video files sent to the server in j2me

    Hi Frens,

    I have a application in j2me in which i am sending the videofiles of desired size in kb.
    the videos that is made on device is visible.but when those files are sent to server,the
    videofiles are not clear as it is on device the videos are blurt on server end.
    so can anyone please tel me how to increase the resolution so that it will be visible
    at server side. Here is my code,what changes should i make so that it works properly.

    Form da=new Form("recording");


    try {



    for(i=0;i<4;i++)
    {
    String PATH = System.getProperty("fileconn.dir.videos") + "video"+i+".3gp";


    player = Manager.createPlayer("capture://video");
    player.realize();
    record = (RecordControl)player.getControl("RecordControl");
    record.setRecordSizeLimit(1000000);
    conn = (FileConnection)Connector.open(PATH,Connector.READ_WRITE);
    if(!conn.exists())
    conn.create();

    stream = conn.openOutputStream();
    record.setRecordStream(stream);

    control = (VideoControl)player.getControl("VideoControl");
    if (control != null) {

    da.append((Item)control.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE,null));
    try {

    control.setDisplayFullScreen(true);
    } catch (MediaException ex) {
    ex.printStackTrace();
    }
    control.setVisible(true);
    dis.setCurrent(da);
    }

    //record.setRecordSizeLimit(100);
    record.startRecord();
    player.start();
    Thread.currentThread().sleep(5000);
    record.commit();
    player.stop();
    player.deallocate();
    player.close();
    conn.close();
    stream.close();
    try{
    //FileConnection fc = (FileConnection) Connector.open("file:///" +"root1/video"+i+".mp4");
    //String SERVER_PATH="http://192.168.1.168/WebApplication1/NewServlet";
    String SERVER_PATH="http://74.208.104.131/WebApplication1/NewServlet";
    //sending file to server!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    FileConnection fc=(FileConnection)Connector.open(PATH,Connector.READ_WRITE);
    //InputStream is=fc.openInputStream();
    int len=(int)fc.fileSize();
    InputStream im=fc.openInputStream();
    byte b[]=new byte[len];
    im.read(b);
    String str=new String(b);

    HttpConnection http=(HttpConnection)Connector.open(SERVER_PATH,Connector.READ_WRITE);
    http.setRequestProperty("Content-length", ""+b.length);

    http.setRequestMethod(HttpConnection.POST);
    OutputStream out=http.openOutputStream();
    //String filename="video"+i+".3gp";
    //String phone=System.getProperty(
    //byte file=filename.getbyte();
    //out.write(file
    String phone="9717916966";
    String filename="recordphoneno="+phone+"filename=video"+i+".3gp*";
    byte[] r=filename.getBytes();
    out.write(r);
    out.write(b);




    out.flush();
    out.close();
    int rs=http.getResponseCode();
    System.out.println("!!!!!!!!!!!!"+rs+"!!!!!!!!!!!!!!!");

    http.close();


    }



    Ritu Singh
    Last edited by ritusingh; 2010-02-04 at 04:36.

Similar Threads

  1. j2se server j2me client bluetooth connection problem
    By bepolat in forum Mobile Java Networking & Messaging & Security
    Replies: 6
    Last Post: 2010-07-14, 11:05
  2. InConsistency in Uploading video files
    By kumar_sai123 in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2007-11-08, 10:14
  3. client server programming in j2me
    By mottaisami in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2006-09-05, 14:43
  4. multiple flush() not work for j2me httpconnection?
    By tiansun in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2006-08-15, 18:59

Posting Permissions

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