|
|
|
JMF
|
|||
|---|---|---|---|
|
#18+
Reshil napisat' programmu katoraja s web kameri snimaet potok dannih.Nashol paru premerov v nete.Ustanovil WEB cameru(Logitech QuickCam (Master)).Vot problema ne mogu polu4it dostup k nej kod: String str2 = "vfw:Microsoft WDM Image Capture (Win32):0"; di = CaptureDeviceManager.getDevice(str2); Vozvrashaet null.4to tolko ne pisal no ne mogu polu4it dostup. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 02.01.2006, 15:31 |
|
||
|
JMF
|
|||
|---|---|---|---|
|
#18+
А что возвращает getDeviceList() ? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 03.01.2006, 08:36 |
|
||
|
JMF
|
|||
|---|---|---|---|
|
#18+
Odni Audio Devajsi.Po4emu ne znaju ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 03.01.2006, 09:24 |
|
||
|
JMF
|
|||
|---|---|---|---|
|
#18+
Привет. Летом я тоже играл с web камерой. Вот код моей программы. /* * Created on 19/06/2005 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ /** * @author leon * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ import javax.swing.*; import javax.media.*; import javax.media.format.*; import javax.media.util.*; import javax.media.control.*; import java.awt.*; import java.awt.image.*; import java.awt.event.*; import com.sun.image.codec.jpeg.*; public class Aleksey extends Panel implements ActionListener { public static Player player = null; public CaptureDeviceInfo di = null; public MediaLocator ml = null; public JButton capture = null; public Buffer buf = null; public Image img = null; public VideoFormat vf = null; public BufferToImage btoi = null; public Aleksey() { capture = new JButton("Capture"); capture.addActionListener(this); String str1 = "vfw:Logitech USB Video Camera:0"; String str2 = "vfw:Microsoft WDM Image Capture (Win32):0"; di = CaptureDeviceManager.getDevice(str2); ml = di.getLocator(); try { player = Manager.createRealizedPlayer(ml); player.start(); Component comp; if ((comp = player.getVisualComponent()) != null) { add(comp,BorderLayout.NORTH); } } catch (Exception e) { e.printStackTrace(); } } public static void main(String[] args) { Frame f = new Frame("Vulf privet"); Aleksey cf = new Aleksey(); f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { playerclose(); System.exit(0);}}); f.add("Center",cf); f.pack(); f.setVisible(true); } public static void playerclose() { player.close(); player.deallocate(); } public void actionPerformed(ActionEvent e) { JComponent c = (JComponent) e.getSource(); if (c == capture) { FrameGrabbingControl fgc = (FrameGrabbingControl) player.getControl("javax.media.control.FrameGrabbingControl"); buf = fgc.grabFrame(); btoi = new BufferToImage((VideoFormat)buf.getFormat()); img = btoi.createImage(buf); } } } Да может быть что при создании проэкта тебе понадобятся джары с JMF. Просто скачай JMF c SUNa. И достань от туда джары. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.01.2006, 16:30 |
|
||
|
|

start [/forum/topic.php?fid=59&msg=33466986&tid=2150536]: |
0ms |
get settings: |
6ms |
get forum list: |
14ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
153ms |
get topic data: |
8ms |
get forum data: |
2ms |
get page messages: |
28ms |
get tp. blocked users: |
1ms |
| others: | 243ms |
| total: | 459ms |

| 0 / 0 |
