Menu

#2 Capture format question and error message

open
nobody
5
2009-06-05
2009-06-05
No

Question: What if the video format for captures on OSX? (.mov, .mpg, etc.)
On OSX,nor the Quicktime Player or VLC does not recognize it.
Or maybe it is because of this (a Creative labs autofocus webcam) :
$ captest -i

Detailed information for capture-device: 0

Name: USB Video Device, Driver: USB Video Class Video

Formats:
0: Y'CbCr 4:2:2 - yuy, fourcc: 1448695129, Resolutions: 640x480, 352x288, 320x240, 176x144, 160x120, 1600x1200

Controls:
Brightness, type: Integer, id: 0, value: 1057, default: 1057, min: 0, max: 65535, step: 1
Blacklevel, type: Integer, id: 1, value: 0, default: 0, min: 0, max: 65535, step: 1
Whitelevel, type: Integer, id: 2, value: 0, default: 0, min: 0, max: 65535, step: 1
Contrast, type: Integer, id: 4, value: 32767, default: 32767, min: 0, max: 65535, step: 1
Hue, type: Integer, id: 3, value: 33314, default: 33314, min: 0, max: 65535, step: 1
Saturation, type: Integer, id: 5, value: 18970, default: 18970, min: 0, max: 65535, step: 1
Sharpness, type: Integer, id: 6, value: 3640, default: 3640, min: 0, max: 65535, step: 1

No input-connectors found.

No output-connectors found.

$ captest -c -f test.dat

Capturing 5 seconds of data from device 0, saving to 'test.dat'.

Format: Y'CbCr 4:2:2 - yuy
Resolution: 640x480
Captured frame: 1 Timestamp: 4544 ms, Valid Bytes: 0TestCaptureHandler: Error writing data.
Captured frame: 2 Timestamp: 4751 ms, Valid Bytes: 614400

$
afaik I have no permission problems.

Discussion

  • Nico Pranke

    Nico Pranke - 2009-06-06

    Seems to me, as if the first captured frame is invalid (0 valid bytes) but the second frame looks ok (614400 valid bytes, as expected). Trying to write 0 bytes results in the write error. You can try adding a check whether the number of valid bytes is greater than 0 before writing the data to the file. Replace line 43 in test/TestCaptureHandler.cpp

    if(mFile)

    by:

    if(mFile && io_buf->getValidBytes() > 0)

    This problem is propably caused by the driver and not by the library.

    Regards

    Nico Pranke

     
  • Nobody/Anonymous

    Ok, I will try.
    Back to the first question, what will the video format be?
    I.e. what file extension should I have on the out put file?

    BN

     
  • Nico Pranke

    Nico Pranke - 2009-06-07

    As the format-description states it is a 4:2:2 subsampled YCbCr-format. This is a raw pixmap format without any compression (see www.fourcc.org for a detailed description). And there is no dedicated file format to save it.. The data will be just saved as a sequence of raw image frames.

    The captest-application is not designed to create files that can be played by any media player but rather to demonstrate how application programmers can use libavcap. The goal of the library is to make raw image data from capture devices accessible to application programmers in an objectoriented and portable way. If you are looking for software that captures video and creates a playable movie-file, there should be enough ready-to-use applications out on the net.

    Greetings

    Nico Pranke

     
  • Bengt Nilsson

    Bengt Nilsson - 2009-06-07

    Thanks, that explains it.
    I was interested in the format just to verify the result.
    Seems I need to check using other methods.

    BN

     

Log in to post a comment.