3 Replies Latest reply on Jun 14, 2018 5:06 AM by MartyG

    I want to save 60 frames per second with png.

    jiin

      I refer to this example librealsense/rs-save-to-disk.cpp at master · IntelRealSense/librealsense · GitHub

      but this sample captures 30 frames and writes the last frame to disk.

      How do I fix this example to save 60 frames per second to disk?

       

        • 1. Re: I want to save 60 frames per second with png.
          MartyG

          I would imagine that on line 30 of the script, you would change i < 30 to i < 60.  This tells the 'For Loop' to keep processing until it reaches the 60th frame, and then go no further and return to the start to begin the loop again and check another 60 frames.

           

          From:

           

          for (auto i = 0; i < 30; ++i) pipe.wait_for_frames();

           

          To:

           

          for (auto i = 0; i < 60; ++i) pipe.wait_for_frames();

          1 of 1 people found this helpful
          • 2. Re: I want to save 60 frames per second with png.
            jiin

            I understand

            but this example only saves the last frame, but I want to store all the frames to disk (all 60 frames)

            Is there anything I need to fix in this code ?

            • 3. Re: I want to save 60 frames per second with png.
              MartyG

              Based on what I have heard from other users about saving PNGs, the program is likely to run very slow if you try to save every frame, and will disrupt the playing of the stream because of this processing lag.  The notes in the script indicate that it is storing up a collection of frames before saving the final frame to give the auto-exposure time to settle.

               

              If you really want to try to save every frame though .. if I were programming this script, I would try deleting lines 37,38 and 56, which seem to set up the 'If' check for whether it is the last frame of the sequence.