Live Video in an Applet
I have a program which captures live video from a video card and puts it on a frame.
When I try to put this in an appplet the sound streams through from the datasource but I can not get the visual aspect to come through.
Are there any issues putting live video into an applet versus putting it into a frame? Are applets capable of
displaying live video?
Thanks
Melissa
You can display visual video components using JMF2.0 (Java Media Framework). You can call getVisualComponent() method of your Player and add it to a Frame on your applet. However the Player has to be realized b4 you can call the getVisualComponent. It's a little tricky, so let me know if you have problems realizing your player. I'm also looking for a Video Player Applet that does not require JMF. So let me know if you find one yourself :)
Similar Messages
-
Can i take live video from TV tuner? how? urgent help is needed
can i take live video from TV tuner? how?
i have downloaded this code for a web cam how can i adjust it to take live video from TV tuner
* WebcamPlayer.java
* Created on November 22, 2004, 4:09 PM
import javax.media.Player;
import javax.media.CaptureDeviceInfo;
import javax.media.MediaLocator;
import javax.media.CaptureDeviceManager;
import javax.media.Manager;
import javax.media.format.VideoFormat;
import java.awt.Component;
import java.applet.*;
import java.util.Vector;
* @author Administrator
public class WebcamPlayer extends Applet
private CaptureDeviceInfo device; // Contains the device properties
private MediaLocator ml; // Contains the location of the media comming from the webcam
private Player player; // the player
private Component videoScreen; // Component that is capable to show the player's visual component
public void init()
try
{ //gets a list of devices how support the given videoformat
Vector deviceList = CaptureDeviceManager.getDeviceList(new VideoFormat(VideoFormat.MJPG) );
//device = CaptureDeviceManager.getDevice("vfw:Creative WebCam NX Pro (VFW):0");
//gets the first device from the deviceList
device = (CaptureDeviceInfo) deviceList.firstElement();
System.out.println("Chosen device: "+device.getName());
//String str1 = "vfw:Creative WebCam NX Pro (VFW):0";
// de webcam indentifiseren
//device = CaptureDeviceManager.getDevice(str1);
//gets the location of the device, is needed for player
ml = device.getLocator();
// makes player and gives the streaming video location (that is locate in the MediaLocator)
// this oparation is blocking until Manager has made a player that is realized.
player = Manager.createRealizedPlayer(ml);
//starts the play
player.start();
//Gets a component from the player that can show the actual streaming from the
//webcam.
videoScreen = player.getVisualComponent();
//adds the component that displays the streaming to the applet.
add(videoScreen);
// Now the user can see the steam that is from the webcam in the applet
catch(Exception e)
System.out.println("no device");
thanks here is my mail if any wants to mail me [email protected]just visit
http://javasolution.blogspot.com/2007/04/java-tv-api-overview.html -
Live Video Broadcasting over LAN
Hi Guys,
I have studied the JMF Framework.
And sucessfully transmitted and received video and audio over a network i.e. LAN.
Also I have successful in displaying Webcam onto applet.
Only issue with me is how do I broadcast the Live Video to clients.
Do help me at the earliest.
Thanks and Regards,Ummm, the same way you broadcast a video file.
You feed the DataSource associated with your web cam through a Processor, program the Processor's tracks to output the encoding you want, and then you send that out via RTP.
And on the receiving end, nothing changes from the video file. -
Stream live video in internet explorer.
hallo
To stream the live video from webcam in internet explorer in system ( as server) and then sending that output to the (PPC) Pocket PC ( as client ) . in the
PPC also video should stream in internet explorer.
plz suggest me some valuable procedures. any person had tried or done this ,plz send me the sample code.
Very Urgent
thanx.Hi...
I wanna know if you did it. I'm a studant and I have some interests to learn how can I show a streaming video through internet.
A couple weeks ago I did two applications make message exchanges by sockets.. I think is something like this. But I wanna know how to get de webcam image and transform it in a stream of bytes to send it to another application.. so the socket server must pass that bytes to the applet in Internet Explorer... I think so... xD
C ya. -
How to display live video captured by a webcam on another computer?
I am now writing a program to display live video captured by a webcam on another computer which is in the same network and I need to make it display on a applet page.
I have already figured out how to capture live video on my own computer and display it on applet.(thank for people in Java forum). But for a webcam which located on another computer in the same network,what should I do? what technique do I need to achieve that?
can anyone help me?
Thank you very muchHi AbSoiLoki,
Thank you for your reply. I have been able to locate a couple of different options here for you to try. There is a previous post for a different printer that is having the same issue with the printer mapping a Z:folder.
The link here will direct you to a post on the HP Forums with some trouble shooting steps for you to try. Click Here.
I have also included another document on How to stop printers from grabbing drive letters, Click Here,
Please let me know if this has been able to help you resolve the issue.
I worked on behalf of HP -
I am new and need help --- Streaming live video
Hello,
I am attempting to stream live video from my Trendnet TV-IP 201 cameras through my web site. We have been able to embed the xplug.class applet into the page, but we can not remove the controls. If someone has any knowledge on this, please help us out. Thanks in advance for the help.
Edited by: bill23stevens on Oct 15, 2007 11:28 AMI have the same problem, need to show and capture the video from Trendnet IP-camera and the same xplug.jar that sits in the camera is decompiled here:
// Decompiled by DJ v3.9.9.91 Copyright 2005 Atanas Neshkov Date: 17.12.2007 11:20:28
// Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name: xplug.java
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.net.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Properties;
import javax.sound.sampled.*;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
public class xplug extends Applet
implements ItemListener, ActionListener, Runnable
class TStreaming
public void seturl(String s, String s1)
try
if(s.indexOf(":") > 0)
m_urlRemoteHost = new URL("http://" + s);
else
m_urlRemoteHost = new URL("http://" + s + ":" + s1);
catch(MalformedURLException malformedurlexception)
System.err.println("MalformedURLException : " + malformedurlexception);
public void init(xplug xplug1)
m_urlRemoteHost = xplug1.getCodeBase();
m_sRemoteHost = m_urlRemoteHost.getHost();
if(m_urlRemoteHost.getPort() <= 0)
m_iRemotePort = new Integer(80);
else
m_iRemotePort = new Integer(m_urlRemoteHost.getPort());
m_iTimeout = Integer.valueOf(xplug1.getParameter("Timeout"));
public void init(String s, String s1, int i)
m_iRemotePort = new Integer(s1);
m_sRemoteHost = s;
m_iTimeout = new Integer(i);
public boolean InitRequest(String s)
if(s.equals("/goform/video2"))
m_stream_type = 1;
else
if(s.equals("/goform/audio2"))
m_stream_type = 2;
else
return false;
m_sRequest = "";
m_sRequest = m_sRequest + "GET " + s + " HTTP/1.0\r\n";
m_sRequest = m_sRequest + "User-Agent: java-mobile\r\n";
m_sRequest = m_sRequest + "Authorization: Basic " + xplug.DeviceSerialNo + "\r\n";
m_sRequest = m_sRequest + "\r\n";
m_bIsConnect = false;
return true;
public boolean OpenSession()
try
m_sktClient = new Socket(m_sRemoteHost, m_iRemotePort.intValue());
m_sktClient.setSoTimeout(m_iTimeout.intValue());
m_Input = new DataInputStream(m_sktClient.getInputStream());
m_Output = new DataOutputStream(m_sktClient.getOutputStream());
m_bIsConnect = true;
catch(IOException ioexception)
m_bIsConnect = false;
return m_bIsConnect;
public void CloseSession()
try
m_Input.close();
m_Output.close();
m_sktClient.close();
m_bIsConnect = false;
catch(Exception exception) { }
public boolean SendRequest()
try
if(m_numsend < 3)
m_Output.write(m_sRequest.getBytes(m_charset));
m_numsend++;
catch(Exception exception)
System.err.println("<err>:SendRequest =" + exception);
return false;
return true;
public int subParameter(String s)
String s1 = s;
int k1 = 0;
String s8 = "\r\n\r\n";
String s9 = "\r\n";
String s10 = "";
String s11 = "";
String s13 = "";
do
int j1 = s1.indexOf(s8);
int i1 = s1.indexOf(s9);
if(j1 == i1)
String s2 = s1.substring(0, i1);
int i = s2.indexOf(":");
if(i > 0)
String s4 = s2.substring(0, i).toLowerCase();
String s6;
if(s4.compareTo("content-type") == 0)
s6 = s2.substring(i + 1, i1).trim();
else
if(s4.compareTo("content-length") == 0)
String s15 = s2.substring(i + 1, i1).trim();
Integer integer2 = new Integer(Integer.parseInt(s15));
m_len = integer2.intValue();
} else
if(s2.indexOf("HTTP") >= 0)
int j = s2.indexOf(" ");
s2 = s2.substring(j + 1, i1);
j = s2.indexOf(" ");
s2 = s2.substring(0, j);
Integer integer = new Integer(Integer.parseInt(s2));
k1 = integer.intValue();
break;
String s3 = s1.substring(0, i1);
int k = s3.indexOf(":");
if(k > 0)
String s5 = s3.substring(0, k).toLowerCase();
String s7;
if(s5.compareTo("content-type") == 0)
s7 = s3.substring(k + 1, i1).trim();
else
if(s5.compareTo("content-length") == 0)
String s16 = s3.substring(k + 1, i1).trim();
Integer integer3 = new Integer(Integer.parseInt(s16));
m_len = integer3.intValue();
} else
if(s5.compareTo("time") == 0)
s10 = s3.substring(k + 1, i1).trim();
else
if(s5.compareTo("usec") == 0)
String s12 = s3.substring(k + 1, i1).trim();
if(s12.length() < 6)
s12 = "0" + s12;
Long long1 = new Long(Long.parseLong(s10 + s12));
Date date = new Date(long1.longValue() / 1000L);
m_sDate = df.format(date);
} else
if(s5.compareTo("userdata") == 0)
String s14 = s3.substring(k + 1, i1).trim();
try
m_sStatus = Long.decode(s14).longValue();
catch(NumberFormatException numberformatexception)
System.err.println("m_sStatus decode failed");
} else
if(s3.indexOf("HTTP") >= 0)
int l = s3.indexOf(" ");
s3 = s3.substring(l + 1, i1);
l = s3.indexOf(" ");
s3 = s3.substring(0, l);
Integer integer1 = new Integer(Integer.parseInt(s3));
k1 = integer1.intValue();
s1 = s1.substring(i1 + 2, s1.length());
} while(true);
return k1;
public int ParseHttp()
int j;
label0:
j = 0;
int k = 0;
String s = "\r\n\r\n";
String s1 = "\r\n";
StringBuffer stringbuffer = new StringBuffer("");
try
do
int i;
if((i = m_Input.read()) != -1)
k = 0;
stringbuffer.append((char)i);
continue;
if(k > 10)
j = subParameter(stringbuffer.toString());
System.err.println("<err>: ParseHttp Retry j>10 ret=" + j);
break label0;
Thread.currentThread();
Thread.sleep(50L);
k++;
} while(stringbuffer.toString().indexOf(s) <= 0);
j = subParameter(stringbuffer.toString());
catch(Exception exception)
System.err.println("<err>: ParseHttp error " + exception);
m_numsend--;
return -1;
m_numsend--;
return j;
public void GetAudioHead(byte abyte0[], TAUHeader tauheader)
byte abyte1[] = new byte[4];
byte abyte2[] = new byte[2];
tauheader.depth = abyte0[0];
tauheader.channel = abyte0[1];
tauheader.adpcm = abyte0[2];
for(int i = 0; i < 4; i++)
abyte1[i] = abyte0[4 + i];
tauheader.speed = xplug.byte2int(abyte1);
tauheader.ref1 = abyte0[8];
abyte2[0] = abyte0[10];
abyte2[1] = abyte0[11];
tauheader.ref2 = xplug.byte2short(abyte2);
for(int j = 0; j < 4; j++)
abyte1[j] = abyte0[12 + j];
tauheader.size = xplug.byte2int(abyte1);
public int ReadData(byte abyte0[])
try
m_Input.readFully(abyte0, 0, m_len);
catch(Exception exception)
return -1;
return m_len;
public int ReadData(byte abyte0[], TAUHeader tauheader)
if(m_len < 16)
return -1;
try
if(m_stream_type == 2)
m_Input.readFully(abyte0, 0, 16);
GetAudioHead(abyte0, tauheader);
m_Input.readFully(abyte0, 0, m_len - 16);
catch(Exception exception)
return -1;
return m_len;
public int uuencode(String s)
char ac[];
int i;
int i1;
int j1;
char ac1[];
String s1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
ac = new char[s1.length()];
ac = s1.toCharArray();
boolean flag = false;
boolean flag2 = false;
long l = 0L;
boolean flag3 = false;
i1 = 0;
j1 = 0;
buf.setLength(0);
if(s.length() < 2)
return -1;
i = s.length();
ac1 = new char;
ac1 = s.toCharArray();
_L6:
boolean flag1;
int j;
long l1;
int k;
flag1 = false;
j = 0;
l1 = 0L;
k = 0;
_L2:
if(i <= 0 && j == 0)
break MISSING_BLOCK_LABEL_256;
long l4;
if(i > 0 && !flag1)
l4 = ac1[i1++];
if(--i < 0)
flag1 = true;
j1 = j;
l4 = 0L;
} else
flag1 = true;
j1 = j;
l4 = 0L;
if(!flag1 || j != 0)
long l2 = l4;
l1 = l1 << 8 & 65535L;
j += 8;
l1 = (l1 | l2) & 65535L;
_L4:
if(j < 6) goto L2; else goto L1
_L1:
long l5;
j -= 6;
long l3 = l1 >> j & 63L;
int k1 = (int)l3;
l5 = ac[k1];
if(k <= 1020) goto L3; else goto L2
_L3:
buf.append((char)(int)l5);
if(flag1)
j = 0;
goto _L4
if(j1 == 2)
buf.append('=');
buf.append('=');
} else
if(j1 == 4)
buf.append('=');
if(i <= 0)
return 1;
if(true) goto L6; else goto L5
_L5:
final int ST_VIDEO = 1;
final int ST_AUDIO = 2;
private String m_charset;
private String m_sRequest;
public String m_sRemoteHost;
private URL m_urlRemoteHost;
public Integer m_iRemotePort;
private Integer m_iTimeout;
private Socket m_sktClient;
private DataInputStream m_Input;
private DataOutputStream m_Output;
public boolean m_bIsConnect;
public int m_numsend;
public int m_len;
public String m_sDate;
public long m_sStatus;
private DateFormat df;
private int m_stream_type;
public StringBuffer buf;
TStreaming()
df = DateFormat.getDateTimeInstance(1, 1);
buf = new StringBuffer("");
m_stream_type = 0;
m_numsend = 0;
m_charset = "8859_1";
m_sRemoteHost = "";
class TAUHeader
byte depth;
byte channel;
byte adpcm;
int speed;
byte ref1;
short ref2;
int size;
TAUHeader()
depth = 0;
channel = 0;
adpcm = 0;
speed = 0;
ref1 = 0;
ref2 = 0;
size = 0;
public class Adpcm
public class AdpcmState
int valprev;
int index;
public AdpcmState()
public String codecName()
return "DVI ADPCM";
public int getSampleRate()
return 8000;
public Object createState()
return new AdpcmState();
public void initState(Object obj)
((AdpcmState)obj).valprev = 0;
((AdpcmState)obj).index = 0;
public int decode(Object obj, byte abyte0[], int i, short aword0[], int j, int k, byte byte0,
short word0)
byte byte1 = 0;
boolean flag = false;
int k1;
int l1;
if(byte0 < 0)
l1 = ((AdpcmState)obj).valprev;
k1 = ((AdpcmState)obj).index;
} else
l1 = word0;
k1 = byte0;
int i2 = stepsizeTable[k1];
k *= 2;
for(int j2 = k; j2-- > 0;)
int i1;
if(!flag)
byte1 = abyte0[i++];
i1 = byte1 >> 4 & 0xf;
flag = true;
} else
i1 = byte1 & 0xf;
flag = false;
k1 += indexTable[i1];
if(k1 < 0)
k1 = 0;
else
if(k1 > 88)
k1 = 88;
int l = i1 & 8;
i1 &= 7;
int j1 = i2 >> 1;
if((i1 & 4) == 4)
j1 += i2 << 2;
if((i1 & 2) == 2)
j1 += i2 << 1;
if((i1 & 1) == 1)
j1 += i2;
j1 >>= 2;
if(0 != l)
l1 -= j1;
else
l1 += j1;
if(l1 > 32767)
l1 = 32767;
else
if(l1 < -32768)
l1 = -32768;
i2 = stepsizeTable[k1];
aword0[j++] = (short)l1;
((AdpcmState)obj).valprev = l1;
((AdpcmState)obj).index = k1;
return k;
private final int indexTable[] = {
-1, -1, -1, -1, 2, 4, 6, 8, -1, -1,
-1, -1, 2, 4, 6, 8
private final int stepsizeTable[] = {
7, 8, 9, 10, 11, 12, 13, 14, 16, 17,
19, 21, 23, 25, 28, 31, 34, 37, 41, 45,
50, 55, 60, 66, 73, 80, 88, 97, 107, 118,
130, 143, 157, 173, 190, 209, 230, 253, 279, 307,
337, 371, 408, 449, 494, 544, 598, 658, 724, 796,
876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066,
2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358,
5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899,
15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767
public Adpcm()
public class CgiIO
public boolean isConnect()
return true;
private int opensock(String s, String s1)
try
URL url = new URL(s + s1);
int i = url.getPort() == -1 ? 80 : url.getPort();
if(!s.equals(gurl) || inet == null)
inet = InetAddress.getByName(url.getHost());
fw_sktClient = new Socket(inet, i);
catch(Exception exception)
System.err.println("<err>: create socket error" + exception);
return 0;
return -1;
public void CgiIO()
public void CgiIO(String s, String s1)
gurl = s;
guri = s1;
opensock(gurl, guri);
public void seturl(String s, String s1)
String s2;
if(s.indexOf(":") > 0)
s2 = "http://" + s;
else
s2 = "http://" + s + ":" + s1;
if(!s2.equals(gurl))
gurl = s2;
opensock(gurl, guri);
public void seturi(String s)
guri = s;
public String getContent()
return ini.content;
public int get()
try
URL url = new URL(gurl + guri);
HttpURLConnection httpurlconnection = (HttpURLConnection)url.openConnection();
httpurlconnection.setRequestProperty("Authorization", "Basic " + xplug.DeviceSerialNo);
httpurlconnection.connect();
if((conlen = httpurlconnection.getContentLength()) > 0)
m_Input = new DataInputStream(httpurlconnection.getInputStream());
m_Input.readFully(buf, 0, conlen);
tStr = new String(buf, 0, conlen);
ini.content = tStr;
httpurlconnection.disconnect();
catch(Exception exception)
System.err.println(exception);
return 0;
return -1;
public int post()
boolean flag = false;
String s = "";
s = s + "POST " + guri + " HTTP/1.0\r\n";
s = s + "User-Agent: java-mobile\r\n";
s = s + "Authorization: Basic " + xplug.DeviceSerialNo + "\r\n";
s = s + "Content-Length: " + ini.content.length() + "\r\n";
s = s + "\r\n";
if(fw_sktClient == null || fw_sktClient.isClosed())
opensock(gurl, guri);
fw_sktClient.setReuseAddress(true);
fw_sktClient.setKeepAlive(true);
fw_sktClient.setSoTimeout(5000);
DataOutputStream dataoutputstream = new DataOutputStream(fw_sktClient.getOutputStream());
BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(fw_sktClient.getInputStream()));
dataoutputstream.write(s.getBytes());
dataoutputstream.write(ini.content.getBytes());
String s1;
if((s1 = bufferedreader.readLine()) != null)
if(s1.indexOf("200") > 0)
flag = true;
else
flag = false;
dataoutputstream.close();
bufferedreader.close();
return !flag ? 0 : -1;
Exception exception;
exception;
System.out.println("post exception:" + exception);
return 0;
public int postproblem()
HttpURLConnection httpurlconnection;
URL url = new URL(gurl + guri);
System.err.println("1post: ini.content " + ini.content);
httpurlconnection = (HttpURLConnection)url.openConnection();
System.err.println("2post: ini.content " + ini.content);
httpurlconnection.setRequestMethod("POST");
System.err.println("3post: ini.content " + ini.content);
httpurlconnection.setDoOutput(true);
httpurlconnection.setDoInput(true);
System.err.println("4post: ini.content " + ini.content);
m_Output = new DataOutputStream(httpurlconnection.getOutputStream());
System.err.println("5post: ini.content " + ini.content);
try
httpurlconnection.setRequestProperty("Authorization", "Basic " + xplug.DeviceSerialNo);
catch(IllegalStateException illegalstateexception)
System.err.println("<err><CgiIO>: ignore1 " + illegalstateexception);
System.err.println("6post: ini.content " + ini.content);
try
httpurlconnection.connect();
break MISSING_BLOCK_LABEL_348;
catch(IOException ioexception)
System.err.println("<err><CgiIO>: ignore1 " + ioexception);
return 0;
System.err.println("7post: ini.content " + ini.content);
m_Output.write(ini.content.getBytes());
httpurlconnection.getResponseCode();
if(httpurlconnection.getResponseCode() != 200)
break MISSING_BLOCK_LABEL_456;
httpurlconnection.disconnect();
System.err.println("8post: ini.content " + ini.content);
System.err.println("-1");
return -1;
httpurlconnection.disconnect();
System.err.println("0");
System.err.println(String.valueOf(httpurlconnection.getResponseCode()) + httpurlconnection.getResponseMessage());
return 0;
Exception exception;
exception;
System.err.println("<err><CgiIO>: " + exception);
return 0;
public int postfile(byte abyte0[], int i)
return 0;
public void ClearParameter()
ini.ClearParameter();
public String GetConfigValue(String s)
return ini.GetConfigValue(s);
public int SetConfigValue(String s, String s1)
return ini.SetConfigValue(s, s1);
public String GetConfigValueEx(String s, String s1)
return ini.GetConfigValueEx(s, s1);
public int SetConfigValueEx(String s, String s1, String s2)
return ini.SetConfigValueEx(s, s1, s2);
public String gurl;
public String guri;
private byte buf[];
private String m_charset;
private Ini ini;
private int conlen;
private String tStr;
InputStream in;
OutputStream out;
DataInputStream m_Input;
DataOutputStream m_Output;
private final int SUCCESS = -1;
private final int FAIL = 0;
Socket fw_sktClient;
InetAddress inet;
int err;
int ic;
public CgiIO()
gurl = "";
guri = "";
buf = new byte[3072];
m_charset = "8859_1";
ini = new Ini();
public class Ini
public void ClearParameter()
content = "";
public String GetConfigValueEx(String s, String s1)
if((i_hos = getSessionHead(s)) >= 0 && (i_tos = getSessionTail(s)) >= 0 && i_tos > i_hos)
return getItemValue(s1, i_hos, i_tos);
else
return "";
public int SetConfigValueEx(String s, String s1, String s2)
if((i_hos = getSessionHead(s)) >= 0 && (i_tos = getSessionTail(s)) >= 0 && i_tos > i_hos)
return setItemValue(s1, s2, i_hos, i_tos);
} else
insertString("[" + s + "]" + dlim + s1 + "=" + s2 + dlim, content.length());
return 0;
public String GetConfigValue(String s)
return getItemValue(s, 0, content.length());
public int SetConfigValue(String s, String s1)
return setItemValue(s, s1, 0, content.length());
private int getSessionHead(String s)
for(int i = 0; (i = getNextLeadingBracket(i)) >= 0;)
i_sepline = getNextClosingBracket(i);
t_session = content.substring(i, i_sepline).trim();
if(t_session.equals(s))
return i;
return -1;
private int getSessionTail(String s)
for(int i = 0; (i = getNextLeadingBracket(i)) >= 0;)
if((i_sepline = getNextClosingBracket(i)) >= 0)
t_session = content.substring(i, i_sepline).trim();
if(t_session.equals(s))
if((i = getNextLeadingBracket(i)) > 0)
return i;
else
return content.length();
return -1;
private int getNextLeadingBracket(int i)
i_hol = i;
for(i_tol = content.indexOf(dlim, i); i_tol < content.length() && i_tol > i_hol; i_tol = content.indexOf(dlim, i_hol))
t_str = content.substring(i_hol, i_tol).trim();
if(t_str.charAt(0) == '[')
return i_hol + 1;
i_hol = i_tol + 2;
return -1;
private int getNextClosingBracket(int i)
i_hol = i;
i_tol = content.indexOf(dlim, i);
i_sepline = content.indexOf("]", i);
if(i_sepline > 0 && i_sepline < i_tol)
return i_sepline;
else
return -1;
private String getItemValue(String s, int i, int j)
i_hol = i;
for(i_tol = content.indexOf(dlim, i_hol); i_tol < j && i_tol > i_hol; i_tol = content.indexOf(dlim, i_hol))
i_sepline = content.indexOf("=", i_hol);
if(i_sepline > 0 && i_sepline < i_tol)
t_item = content.substring(i_hol, i_sepline);
if(t_item.trim().equals(s))
return content.substring(i_sepline + 1, i_tol).trim();
i_hol = i_tol + 2;
return "";
private int setItemValue(String s, String s1, int i, int j)
i_hol = i;
i_tol = content.indexOf(dlim, i_hol);
isChanged = false;
for(; i_tol < j && i_tol > i_hol; i_tol = content.indexOf(dlim, i_hol))
i_sepline = content.indexOf("=", i_hol);
if(i_sepline > 0 && i_sepline < i_tol)
t_item = content.substring(i_hol, i_sepline);
if(t_item.trim().equals(s))
isChanged = true;
return replaceString(s1, i_sepline + 1, i_tol);
i_hol = i_tol + 2;
if(!isChanged)
insertString(s + "=" + s1 + dlim, j);
return 0;
private int insertString(String s, int i)
StringBuffer stringbuffer = new StringBuffer(content);
content = stringbuffer.insert(i, s).toString();
return 0;
private int replaceString(String s, int i, int j)
StringBuffer stringbuffer = new StringBuffer(content);
content = stringbuffer.replace(i, j, s).toString();
return 0;
public String content;
private int i_hol;
private int i_tol;
private int i_ho -
Recently my Macbook Pro (June 2011, i7, 8gb RAM, 512gb SSD, AMD Radeon 6750, Mountain Lion - since July - currently 10.8.2) has been presenting me with an array of problems, usually initiated when I am streaming live video. I was streaming Time Warner Cable on 12/9 and it gave me what looked like the blue screen of death. It started up after about five attempts that time. The other day, after about a week of not using the computer, it wouldn't boot past the grey screen. I (option) started it and it gave me two boot choices, the regular HD and a "10.8 restore" option. The HD gave me the grey screen and the restore option gave me the dark blue screen. I reset PRAM and that didn't work. After a force (x) start it worked. Today, I was using "Watch ESPN" and the screen froze and the computer did some kind of repeating RAM beep or something. I rebooted and it started up fine. I'm not watching any videos anymore, but this is a problem since the primary purpose for my mbp is video editing. I'm still under AppleCare but I find more solid answers in the forums or at least better questions for the AppleCare people.
Anybody have similar experiences, or a solid idea of what the heck has happened to my machine?I'm not really sure what method that person was talking about. I just read he had a successful install so I posted it.
But I'll hazard a guess
1. copy your entire drive to a backup drive
2. boot into that drive and test it out - make sure its a flawless backup, it works, and the hard drive has no problems
3. eject that drive, disconnect it and reboot into the leopard install dvd
4. erase your main hard drive using disc utilities on the leopard install dvd -- you've made a backup, made sure that backup was good, and disconnected it so it's currently safely disconnected from the leopard install you're about to do. Also, on the hard drive you're erasing and installing leopard on to, many people recommend "Zeroing" it as well as erasing it. That option is part of the erase function in disc utilities on the leopard install disc.
5. do a clean install of leopard
6. follow step 4 from that original post exactly as that person described to do.
7. read the rest of what they said
That's pretty much it. With the backup/erase/clean install/import/ you pretty much get everything you need exactly the way you want it with very few things missing -- and you've done this over a clean install. Plus that poster did mention that you can select what you want to import from your backup hard drive.
It sounds like its a "clean install" method that gives you control via "import from machine" option in the installer. Control over what parts of your "old mac" you want to import into your "new leopard mac".
Hopefully that helps. It sounds more involved, but its actually pretty quick and provides you with a perfectly save backup in case anything goes wrong with the leopard install. -
Can I connect an external video camera to a mac book pro for viewing live video so I don't have to use the little screen on the camera?
Shadow30 wrote:
Can I connect an external video camera to a mac book pro for viewing live video so I don't have to use the little screen on the camera?
• Only if your video camera supports it. Depending on how your camera works, you may need to add preview software to your Mac to use this feature.
• Alternatively, your camera may also be able to record directly into your Mac while you are monitoring the Mac's display.
• If you are using a consumer camcorder that supports HDMI monitoring, a small HDTV might be an simpler solution than your Mac. For an example of how this is done, see http://youtu.be/GVpSkZD6qE4.
• The retailer who sold you your video camera may have other suggestions.
• If you need more professional results, an external preview monitor will offer more capability on compatible cameras.
Message was edited by: EZ Jim
Mac OSX 10.9.4 -
Is there a way to use Illustrator to draw over a live video feed coming from my microscope?
Hi, we use illustrator to draw (trace) over static images of mite specimens taken under a microscope. Although this works, it would be much better to be able to draw directly from the live video feed coming from my microscope. The specimens are dead, so they are not moving around, however, we need to focus down through the specimen in order to see all details. We normally take montage images, but because the specimens are clear there are many artifacts present and we frequently have to consult the specimen under the microscope to double check things. My students and I have hundreds of drawings to complete and are looking for a way to streamline the process. If we could avoid making montage images and draw direct from the video feed, it would revolutionize the way we approach our research. Is there a way to display the video feed and then overlay Illustrator so that we can directly trace over the image (we use a Wacom tablet, but that shouldn't make a difference) so we can focus at different levels and draw the entire organism?
Thanks for your help
AshleyMaybe it's possible to have live video in Illustrator, but you would most certainly need to write your own plugin.
So this community would be suitable:
http://forums.adobe.com/community/illustrator/illustrator_sdk?view=discussions -
Hello. I want to use my iphone as a viewing screen for a usb endoscope, (its a small camera on a long cable for inspecting down piping and such) with your app is it possible to attach the usb to my iphone using a adapter to watch the live video feed on the iphone?
Thankyou.Hello. I want to use my iphone as a viewing screen for a usb endoscope, (its a small camera on a long cable for inspecting down piping and such) with your app is it possible to attach the usb to my iphone using a adapter to watch the live video feed on the iphone?
Thankyou. -
Join us at 12:00pm Pacific time for a LIVE video tutorial of how to upgrade or replace RAM! The video features HP experts who work with the products every day!
I am an HP employee.#test
-
Join us at 1:00pm Pacific time for a LIVE video tutorial of how to replace a video card and configure video settings! The video features HP experts who work with the products every day!
I am an HP employee.#test
-
Join us at 2:00pm Pacific time for a LIVE video tutorial of how to prepare for system backup and recovery! The video features HP experts who work with the products every day!
I am an HP employee.#test
-
Join us at 11:00am Pacific time for a LIVE video tutorial of how to replace a hard drive! The video features HP experts who work with the products every day!
I am an HP employee.#test
-
What are the requirements to build a live video chat application?
I am looking into making a live video chat application. I
have seen several examples on the web so my question is not "how"
to do it. My question is "what do I need" to do it?
It seems that all the examples use Flex Data Services and
then some sort of back-end communication server. The cost of FDS is
well beyond what the client can afford so my question is: is it
necessary? Is there a way to build this sort of application without
FDS? Can I get live video streaming to work using only what is in
the SDK? I know nothing about data streaming, real-time
communication, etc. and have no idea how to implement this outside
what I have seen in the online articles so far.
If there are any other forums that are more appropriate to
this question, please direct me there. It is not a FDS exclusive
issue and I am just starting to look into it. I am starting here
because we would like to use Flash Player for the client-side
application.I am looking into making a live video chat application. I
have seen several examples on the web so my question is not "how"
to do it. My question is "what do I need" to do it?
It seems that all the examples use Flex Data Services and
then some sort of back-end communication server. The cost of FDS is
well beyond what the client can afford so my question is: is it
necessary? Is there a way to build this sort of application without
FDS? Can I get live video streaming to work using only what is in
the SDK? I know nothing about data streaming, real-time
communication, etc. and have no idea how to implement this outside
what I have seen in the online articles so far.
If there are any other forums that are more appropriate to
this question, please direct me there. It is not a FDS exclusive
issue and I am just starting to look into it. I am starting here
because we would like to use Flash Player for the client-side
application.
Maybe you are looking for
-
How to save 4 versions of a file in the application server
Hi, I have to write a program which will extract few data from SAP and write it in a file in the SAP application server. This program will be run once every month. I need to save 4 versions of the files, current and 3 prior. These versions should
-
Oracle 10.1.0.4 on Windows Server 2008 64 bits Standard
Hello, For migratiion purposes, we would need to install Oracle 10.1.4.0 on a Windows Server 2008 64 bits Standard, and then upgrade it to 11g. We have forced Oracle 10.2.0.4 installation on a Windows Server 2008 64 bits Standard, but we are not sure
-
How to put a web link in the detailed navigation
How can you put a web link in the detailed navigation? I know that if your role contains iviews that are 3 levels down (default), then the link to the iview will appear in the detailed navigation. But, I want to put a link to a external site in the d
-
ALV heading required using ALV opps-urgent
Hi All, I developed one report which is displaying ouput in grid using ALV OOPS concept. i need heading as foloows. Header : Program ID : EDI report program name Date/Time : date/time where the report is generated Page No : User id : logon ID anybody
-
LR5 Export to Nik HDR Efex Pro 2
Win 7, 64 bit, LR5.2RC, Nik HDR Efe Pro 2.... From Export > HDR Efex Pro 2 it used to pause at a screen providing three choices (from memory), "as copy with LR adjustments", "as copy without LR adjustments" or "as orignal". Now it skips that screen