I'm looking to record the preview stream to a video on the host using C++ instead of Python. In searching the forum I found How to record color video with 1920*1080 resolution? and its links to documentation including recording with DepthAI.

Unfortunately, the examples are only in Python and I'm wondering if there are C++ examples (it seems the SDK code samples are solely in Python where API code samples are in both Python and C++).

The Python example that seems the most promising is gen2-container-encoding but I don't know the best C++ equivalent for L44's av Python dependency. I also don't know if there are more modern ways to record in C++ using depthai as this seems like it is or should be an out-of-the-box feature.

So my questions are:

  1. What are my options for recording the preview stream to a video on the host using C++? Ideally to an mp4.
  2. Must the host have ffmpeg installed to create the final mp4? I ask as my customers aren't guaranteed to have ffmpeg installed (which suggests to me that I'll need to update my custom dll to also include it and any other dependencies)

    Hi luxd
    SDK is python only. You have examples here - second code tab is c++ code.
    As for ffmpeg, you can probably use c++ wrapper or library that uses it, so you don't have to manually download it.

    Thanks,
    Jaka

    • luxd replied to this.

      Thank you jakaskerl . I ended up using opencv VideoWriter.

      How do you mark this as resolved? It is not obvious how to do so.

      13 days later

      Hi @luxd, could you please let me know also how did you save using VideoWrite, I am facing few issues such as speed seems to be to 2x~3x