Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Tags in this Discussion

Nvidia Quadro FX SDI video capture
  • Dear All,

    Currently I'm working on an opensource project related to video capture from HD camera (1920x1080).
    The project is at very beginning but already have a serious technical issue.
    Aims of the project: Capture video from the HD camera using Quadro FX SDI video capture card and NVidia FX5800 graphics card for encoding.

    Essence of the issue
    ----------------------
    After all successful initialization steps video capture has failed with an error.Please, see details below.

    Issue description
    ----------------------

    In my research steps I was guided by NVIDIA Quadro SDI capture programmer's guide (http://www.nvidia.com/docs/IO/40049/PG-03776-001_v05.pdf) and OpenGL NVIDIA video capture extension (http://www.opengl.org/registry/specs/NV/video_capture.txt).

    When I call VideoCaptureNV, I always get the following error:

    INVALID_VALUE from the OpenGL extension. Please, see at the end of this question short description of the VideoCaptureNV method.

    Really, I can't understand the reason for that. Unfortunately, I don't have a possibility to check whether the video capture works correctly with my parameters on Windows platform.

    I've attached the test project sources to this question. It is a simple test application.

    It consist of the following parts:

    1. OpenGL initialization
    2. OpenGL context initialization
    3. Capture card initialization
    4. Start capturing of video frames

    Here is short excerpt from video_capture.txt document mentioned above:

    ================================================
    enum VideoCaptureNV(uint video_capture_slot, uint *sequence_num,
    uint64EXT *capture_time);

    can be called to capture one frame of video. If no frames are
    available, this call will block until frames are ready for capture
    or an error occurs. VideoCaptureNV will return one of SUCCESS_NV,
    PARTIAL_SUCCESS_NV, or FAILURE_NV. If the capture operation
    completed successfully on all stream with objects bound, SUCCESS_NV
    is returned. If some streams succeeded PARTIAL_SUCCESS_NV is
    returned. If the capture failed on all streams, or if the capture
    state on the specified slot is invalid, FAILURE_NV is returned. In
    addition, the following GL errors are generated if FAILURE_NV was
    returned because of invalid capture state:

    * INVALID_OPERATION if any stream has both texture and buffer
    objects bound.

    * INVALID_VALUE if any buffer objects bound are not large enough
    to contain the the data from the region they are bound to at the
    specified offset.

    * INVALID_VALUE if the dimensions of any textures bound do not
    match the dimensions of the region they are bound to.

    * INVALID_OPERATION if the base level of any textures bound has
    not been defined.

    * INVALID_OPERATION if the internal formats of any textures bound
    to the same stream does not match.

    * INVALID_OPERATION if automatic mipmap generation is enabled for
    any textures bound.

    =====================================================

    If you need some other info, please ask me and I'll provide it in a moment.

    --
    Thanks to all in advance,
    Alexey
    video_capture.tgz
    40K
  • 5 Comments sorted by
  • I forgot to post the output from my test application. It is describes the error behaviour:


    Getting matching framebuffer configs
    Found 12 matching FB configs.
    Getting XVisualInfos
    Matching fbconfig 0, visual ID 0x25: SAMPLE_BUFFERS = 0, SAMPLES = 0
    Matching fbconfig 1, visual ID 0xbb: SAMPLE_BUFFERS = 0, SAMPLES = 0
    Matching fbconfig 2, visual ID 0x39: SAMPLE_BUFFERS = 1, SAMPLES = 2
    Matching fbconfig 3, visual ID 0xcf: SAMPLE_BUFFERS = 1, SAMPLES = 2
    Matching fbconfig 4, visual ID 0x3b: SAMPLE_BUFFERS = 1, SAMPLES = 4
    Matching fbconfig 5, visual ID 0xd1: SAMPLE_BUFFERS = 1, SAMPLES = 4
    Matching fbconfig 6, visual ID 0x49: SAMPLE_BUFFERS = 1, SAMPLES = 8
    Matching fbconfig 7, visual ID 0xdf: SAMPLE_BUFFERS = 1, SAMPLES = 8
    Matching fbconfig 8, visual ID 0x4b: SAMPLE_BUFFERS = 1, SAMPLES = 16
    Matching fbconfig 9, visual ID 0xe1: SAMPLE_BUFFERS = 1, SAMPLES = 16
    Matching fbconfig 10, visual ID 0x55: SAMPLE_BUFFERS = 1, SAMPLES = 32
    Matching fbconfig 11, visual ID 0xeb: SAMPLE_BUFFERS = 1, SAMPLES = 32
    Chosen visual ID = 0x55
    Creating colormap
    Creating window
    Mapping window
    Creating context
    Created GL 3.0 context
    Direct GLX rendering context obtained
    Making context current
    Number of active jacks: 4
    ===> Configured a double-link stream
    Cycle 0
    > Set bits per component
    > Set signal format
    > Set component sampling
    > Set chroma sampling
    ===> Cycle finished. Begin data transfer preparations
    ===> Num devices: 1
    ===> ID matchs 768.
    Device locked
    ==> Device bound
    ===> Buffer pitch: 5120
    ===> Capture has begun
    Sequence num: 32720, timestamp: 4131212846
    Frame 0 failured
    Invalid value
    Sequence num: 32720, timestamp: 4131212846
    Frame 1 failured
    Invalid value
    Sequence num: 32720, timestamp: 4131212846
    Frame 2 failured
    Invalid value
    Sequence num: 32720, timestamp: 4131212846
    Frame 3 failured
    Invalid value
    Sequence num: 32720, timestamp: 4131212846
    Frame 4 failured
    Invalid value
    Sequence num: 32720, timestamp: 4131212846
    Frame 5 failured
    Invalid value
    Sequence num: 32720, timestamp: 4131212846
    Frame 6 failured
    Invalid value
    Sequence num: 32720, timestamp: 4131212846
    Frame 7 failured
    Invalid value
    Sequence num: 32720, timestamp: 4131212846
    Frame 8 failured
    Invalid value
    Sequence num: 32720, timestamp: 4131212846
    Frame 9 failured
    Invalid value
    Sequence num: 32720, timestamp: 4131212846
    Frame 10 failured
    Invalid value
    ===> Capture ended
    ===> Resources freed
  • It looks like the buffer is small for capturing but it big enough...
  • You need to use one internal formats for buffer bindings, eg. YCBYCR8_422_NV:

    "The internal format of the pixel data stored in the buffer object can be
    specified using the VideoCaptureStreamParameter functions described
    below, with set to VIDEO_BUFFER_INTERNAL_FORMAT_NV and
    set to a color-renderable internal format (as defined in
    section 4.4.4), or one of the Y'CbCr/Y'CbCrA formats defined in
    table 4.13. Specifying other internal formats will generate
    INVALID_ENUM."

    Addmittedly the spec example is wrong there. Let me know if that solves your issue and I will update the spec.
  • Thanks a lot for the provided info! I'll check it in 2-3 hours and let you know the status.
  • It works now! Thank you very much for the support! Actually, I've found a code example in Linux SDK which shows how to use VIDEO_BUFFER_INTERNAL_FORMAT_NV.