Skip to main content

BFS-U3-19S4M-C stream live video

Comments

9 comments

  • TDY_Ifeanyi
    Community team
    Great answers
    Expert (Gold)

    Hi Grégory,

    I am not sure if I understood what you intend to accomplish correctly. Have you tried using SpinSimpleGUI_MFC or following similar implementation in your project and it is not working fine?

    A library is required to render images, and our SpinSimpleGUI_MFC example project is one way to implement this in C++ language. If you do not require the GUI elements, another alternative is to use OpenCV library as shown in our github example: https://github.com/Teledyne-MV/Spinnaker-Examples/tree/main/AcquisitionOpenCV

    I am looking forward to your response.

    Best regards,

    Ifeanyi

    0
  • Grégory BAERT

    Hello Ifeanyi,

    Thank you.

    I first tried using the SpinSimpleGUI_MFC project, and after re installation of Spinnaker 4 with direct show third party, this project works fine. The project "SpinSimpleGUI_DirectShow" works fine too.

    I'm currently developing a software for a client in C++ using the Qt 6 + QML framework. (not in MFC)

    I would like to stream image on a viewer after connexion like SpinView software

    I read yesterday that Qt 6 no longer uses DirectShow but Windows Media Foundation.

    For live streaming, could I get the data in "unsigned char*" and then display it in a viewer ?

    Best regards,

    0
  • Grégory BAERT

    Hello,

    I've found a way to retrieve an image as an unsigned char*, using the "GetData" method.

    https://softwareservices.flir.com/Spinnaker/latest/class_spinnaker_1_1_image.html#a45b28c54e2ee57571e4d79ea0d20e41e

    However, according to the link above, you shouldn't use the "Release" method?

    Do you have a basic example of how to use this method, please ?

    Thank you,

    Best regards,

    0
  • TDY_Ifeanyi
    Community team
    Great answers
    Expert (Gold)

    Hello Grégory,

    Sorry for delay in getting back to you, and glad to know you were able to find solution for it. Yes, it means image.Release() should not be called prior to using the image data. 

    Alternatively, I would deepcopy current mage to another object before calling release method.

    We do not have example project for using this method, but spinnaker C++ API documentation (default location: C:\Program Files\Teledyne\Spinnaker\doc\C++) contains code snippet on how to retrieve image data from spinnaker ImagePtr object. 

    I will paste the code snippet here for ease of reference:

    // Assuming image is 640 x 480 resolution. The current pixel format as well as PixelColorFilter indicate the Bayer Tile Mapping for the camera. For example, BayerRG8 is RGGB.

    ImagePtr pResultImage = cam.GetNextImage();
    char* data = (char*)pResultImage->GetData();

    // Assuming image is 640 x 480
    // data[0] = Row 0, Column 0 = red pixel (R)
    // data[1] = Row 0, Column 1 = green pixel (G)
    // data[640] = Row 1, Column 0 = green pixel (G)
    // data[641] = Row 1, Column 1 = blue pixel (B)

    I hope this helps to answer your question.

    Best regards,

    Ifeanyi

    0
  • Grégory BAERT

    Hello,

    Thank you,

    I don't know if it is important but, I set the camera's handle mode to "NewestOnly".

    My test program crashes when I try to make a deep copy. This is a part of my log file:

    [ERR ] - 16:18:52.517 - Spinnaker: NULL pointer dereferenced. [-1015]
    [ERR ] - 16:18:53.176 - [-1015] raised in function Spinnaker::BasePtr<class Spinnaker::IImage,class Spinnaker::IImage>::operator -> at line 155

    Best regards,

    0
  • Grégory BAERT

    Hello,

    Sorry, I wanted to test as quickly as possible last Friday. I forgot to instantiate my variable before : Spinnaker::Image::Create()

    I'm now going to check the data returned by the 'GetData()' method and convert the variable (unsigned char*) to QImage in Qt.

    Thank you,

    Best regards,

    0
  • Grégory BAERT

    Hello,

    I recover the array (unsigned char*) and converted it to 'data:image/"png";base64,', to display it in the GUI part in QML (Image - Qt 6)

    Best regards,

    0
  • TDY_Ifeanyi
    Community team
    Great answers
    Expert (Gold)

    Hello Grégory,

    Nice to know you have made a significant progress on this implementation. I presume this issue is resolved, or is there still question you would like to discuss further?

    Best regards,

    Ifeanyi

    0
  • Grégory BAERT

    Hello,

    Thank you for your reply. Yes, this discussion is over.

    Best regards,

    0

Please sign in to leave a comment.

Powered by Zendesk