BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 04-01-2010, 06:46 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Jan 2010
Model: 8900
PIN: N/A
Carrier: trainee
Posts: 30
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Video sending to server

Please Login to Remove!

hi,

i m trying to develop an application which will record the video clips (suppose 3 clips) and thn send it to server.
but the prob is
i m able to make video clips but during sending clips to server what happens
1st video clip is not sent to d server while rest clips are sent successfully.

while on server side 1st clip video size is visible,as i m using
System.out.print(request.getContentLength());

but after that it shows 2nd clip size,rather thn 1st writting video file to server.

plz help me rearding this

thnks,
Offline  
Old 04-01-2010, 09:44 AM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2010
Model: N/A
PIN: N/A
Carrier: Fledge
Posts: 43
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

You will need to post much more detailed server and client side information for us to help you with this.
Offline  
Old 04-05-2010, 04:22 AM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Jan 2010
Model: 8900
PIN: N/A
Carrier: trainee
Posts: 30
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Reply

hi,

thnks 4 ur response,
i m sending my code to u:

class StartRecordingThread extends Thread
{
public void run()
{
videoEncodings = System
.getProperty("video.encodings");

final boolean hasVideoRecording = videoEncodings != null
&& videoEncodings.length() > 0;

if (player == null || recorder == null)
{
if (hasVideoRecording)
{
int encodingSpace = videoEncodings
.indexOf(' ');
if (encodingSpace != -1)
{
videoEncodings = videoEncodings
.substring(0, encodingSpace);
}
player = Manager
.createPlayer("capture://video?"
+ videoEncodings);
player.start();
VideoControl video = (VideoControl) player
.getControl("VideoControl");
cameraView = (Field) video
.initDisplayMode(
VideoControl.USE_GUI_PRIMITIVE,
"net.rim.device.api.ui.Field");
getApplication().invokeLater(new Runnable()
{
public void run()
{
add(cameraView);
}
});

}

else
{
player = Manager
.createPlayer("capture://audio");
player.start();
}
recorder = (RecordControl) player
.getControl("RecordControl");
}


for(int i=0;i<4;i++)
{
String PATH = System.getProperty("fileconn.dir.videos") + "truncate"+i+".3gp";
try{
conn = (FileConnection)Connector.open(PATH,Connector.READ _WRITE);
if(!conn.exists())
conn.create();
conn.truncate(0);
// conn.close();
OutputStream out=conn.openDataOutputStream();
recorder.setRecordStream(out);
recorder.startRecord();
recording = true;
Thread.currentThread().sleep(5000);
recorder.stopRecord();
recorder.commit();
recording = false;
out.close();
conn.close();
FileConnection fc=(FileConnection)Connector.open(PATH,Connector.R EAD_WRITE);
InputStream is=fc.openInputStream();
final int len=(int)fc.fileSize();
byte b[]=new byte[len];
is.read(b);
String str=new String(b);
is.close();
fc.close();
HttpConnection http=(HttpConnection)Connector.open(URL);
http.setRequestMethod(HttpConnection.POST);
DataOutputStream out1=http.openDataOutputStream();
out1.write(b,0,b.length);
out1.flush();
http.close();

}
if(i==3)
{
player.stop();
player.deallocate();
}
}//end of for loop

this code i m using,but d prob is,it starts sending file to server from second file,while for the 1st,contentlength() is displaying on server side,
but after that it enters into phase,where it starts sending from second file.

dont know where i m mistaking

thnks
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Mother Board A20B-1003-0760/03A Fanuc
$684.8
Mother Board A20B-1003-0760/03A Fanuc pictureUsed Motherboard Gigabyte GA-8IP775-G DDR400 AGP LGA 775 USB 2.0 For Parts
$199.0
Used  Motherboard Gigabyte GA-8IP775-G DDR400 AGP LGA 775 USB 2.0 For Parts pictureDatex Ohmeda AS/3 Compact Monitor Backplane, Motherboard,F-CM BSB, DC-DC Module
$199.0
Datex Ohmeda AS/3 Compact Monitor Backplane, Motherboard,F-CM BSB, DC-DC Module  pictureMini Infrared hot air Laptop motherboard repair machine A01
$661.5
Mini Infrared hot air Laptop motherboard repair machine A01  pictureManufactural Computer motherboard refurbishing equipment soldering station A09L
$1217.99
Manufactural Computer motherboard refurbishing equipment soldering station A09L picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.