JMF webcam problem

Discussion in 'Java' started by Roedy Green, Apr 4, 2004.

  1. Roedy Green

    Roedy Green Guest

    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.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, Apr 4, 2004
    #1
    1. Advertising

  2. 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...
    Knute Johnson, Apr 4, 2004
    #2
    1. Advertising

  3. Roedy Green

    Roedy Green Guest

    On Sun, 04 Apr 2004 07:04:54 GMT, Knute Johnson
    <> 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.
    Roedy Green, Apr 6, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roedy Green

    JMF webcam support

    Roedy Green, Apr 19, 2004, in forum: Java
    Replies:
    5
    Views:
    13,077
    Roedy Green
    Apr 20, 2004
  2. Mirko Hansen

    JMF/Webcam on Mac OS X

    Mirko Hansen, Jan 6, 2005, in forum: Java
    Replies:
    1
    Views:
    5,256
  3. Roland Poellinger
    Replies:
    2
    Views:
    7,317
    Roland Poellinger
    Feb 28, 2005
  4. Replies:
    0
    Views:
    684
  5. Desk-of-David
    Replies:
    6
    Views:
    7,165
    Desk-of-David
    Apr 6, 2007
Loading...

Share This Page