Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JMF webcam problem

Reply
Thread Tools

JMF webcam problem

 
 
Roedy Green
Guest
Posts: n/a
 
      04-04-2004
I have written a simple little program based on Knute's Webcam
that just takes a snap from a video camera and saves it to disk.

grabber = (FrameGrabbingControl)player.getControl(
"javax.media.control.FrameGrabbingControl");
System.out.println( "grabber:" + grabber );

grabber:com.sun.media.renderer.video.GDIRenderer@7 109c4

It works fine with RGB formats, but with YUV, I just get an empty
buffer on

javax.media.Buffer buf = grabber.grabFrame();
System.out.println("raw:" + buf.getLength() );

The problem is cheap webcams don't support RGB formats.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
Reply With Quote
 
 
 
 
Knute Johnson
Guest
Posts: n/a
 
      04-04-2004
Roedy Green wrote:

> It works fine with RGB formats, but with YUV, I just get an empty
> buffer on


YUV requires a codec for converting to RGB before rendering. When
JMStudio runs it even uses a different renderer when displaying YUV
format video. I've played with it every way I can think of but can't
get it to work correctly with YUV. The next step is to start through
the JMStudio code. A cursory look though and there is a lot of
com.sun... code in there.

--

Knute Johnson
email s/nospam/knute/
Molon labe...
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      04-06-2004
On Sun, 04 Apr 2004 07:04:54 GMT, Knute Johnson
<(E-Mail Removed)> wrote or quoted :

>YUV requires a codec for converting to RGB before rendering.


I have discovered these two codes for doing that
com.sun.media.codec.video.vcm.NativeDecoder
com.sun.media.codec.video.colorspace.YUVToRGB

However they naturally would be used AFTER the raw frame grab. But
the raw frame grab is getting 0 bytes. Phht!

I have another theory. Perhaps the FrameGrabber for YUV only works on
a moving stream. I will try setting that up.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
Reply With Quote
 
 
 
Reply

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
API Jmf:Transcoding to different formats (Solution SUN jmf: "Transcode.java ) Misterysword@hotmail.com Java 0 08-13-2007 11:40 AM
A bug of JMF(when JMF is playing video, InterruptedException occurs after the "refresh" button of IE is clicked)? taowang.gml@gmail.com Java 1 07-19-2006 11:21 PM
JMF: controlling webcam color settings from java Roland Poellinger Java 2 02-28-2005 11:23 PM
JMF/Webcam on Mac OS X Mirko Hansen Java 1 01-25-2005 01:27 PM
JMF webcam support Roedy Green Java 5 04-20-2004 08:53 PM



Advertisments