Skip to main content

Saving direct to video file

Answered

Comments

7 comments

  • Official comment
    TDY_Demos
    Community team
    Expert (Gold)

    Thanks Gregory and Manuel for your ideas and feedback.

    Using OpenCV and looking at our AcquisitionMultipleCamerasWriteToFile example are good ways to get over the issue of the conversion time being longer than the incoming framerate.

    We also have an example of taking saved raw images and loading them back into Spinnaker objects to save your AVI in post processing (Spinnaker-Examples/RawToProcessed at main · Teledyne-MV/Spinnaker-Examples · GitHub).  Saving images as raw would be the quickest method to save, however it would take a lot of hard drive space.

    SpinView does save AVIs as well as you mention, but it buffers images in RAM if the write speed is slower than the incoming datarate.  To do this in the API, you would allocate as many buffers as you can for the RAM that you have, use the OldestFirst buffer handling method, and grab/save your images to avi.  This way you have a slower increase in your used RAM depending on your processing/write speed, and you don't have to buffer up your whole recording before saving your AVI. 

    Our BufferHandling example code in our SDK can help with setting the correct mode and the number of buffers.

    Thank you,

    Demos

  • Grégory BAERT
    Idea generator
    Great answers

    Hello,

    An example of how to create an AVI file is provided with the SDK : Project name is SaveToAvi

    Best regards,

    0
  • Stefan Rogers

    Hi,

    Thanks for the reply. I've seen that example but as far as I can tell doesn't script just save the video into memory first and then compress after? I'm looking to do some very long recordings and wouldn't have the RAM for that if so, so am looking to see if there's a way that writes to a video file on the fly. Do you know if the example given is the same way that SpinView processes video saving under the hood? Let me know if I'm mistaken though.

    Thanks,

    Stefan

    0
  • Grégory BAERT
    Idea generator
    Great answers

    Hello,

    I am not an expert in Flir SDK. I don't know if this is possible with the SDK. Perhaps you should take a look at the Opencv library ?

    From memory, you can create videos on the fly ...

    Best regards,

    0
  • Stefan Rogers

    Ok, I'll look further into it. Thanks for the help.

    Stefan

    0
  • TDY_Manuel
    Community team
    Expert (Gold)

    Hi Stefan, if processing and saving takes too long, you might also want to take a look at the source code example AcquisitionMultipleCamerasWriteToFile. That example saves the raw image data to a big single file first and extracts images for processing after recording finishes. 
    Manuel

    0
  • Stefan Rogers

    Hi all, 

    Thanks very much for the help, I'll try implementing some of these suggestions and see what works best. Glad you mentioned the way the WriteToFile example works, I'd missed that detail, seems like a good solution. 

    Thanks again,

    Stefan

    0

Please sign in to leave a comment.

Powered by Zendesk