JMF webcam problem

R

Roedy Green

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@7109c4

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.
 
K

Knute Johnson

Roedy said:
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.
 
R

Roedy Green

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top