13 Replies Latest reply on Jul 12, 2018 6:20 AM by MartyG

    Color stream capped at 15 FPS @ 1920x1080 (D415)

    tiwoti

      Hi there,

       

      During a 1920x180 color stream the RealSense viewer is only showing max 15 FPS, whilst 30 FPS is selected (D415, firmware 05.09.13.00).

      The 1280x720 stream is correctly streaming at 30 FPS.

      The camera is connected to a USB 3.2 port with the original usb cable and the used CPU is an i7-7700HQ.

      I've tested multiple color formats, but I mainly focused on the YUYV format.

       

      I saw that there were some CPU issues with the viewer that are being worked on, and I'm not sure if this is the bottleneck.

      Streaming cpu high usage fix by abernste · Pull Request #1844 · IntelRealSense/librealsense · GitHub

      [realsense2] high CPU utilization · Issue #744 · IntelRealSense/librealsense · GitHub

      So I've tried compiling the master code with OpenMP enabled and disabled, but both show max 15 FPS at 1080p for the color recording.

       

      I've also tested a very simple script for saving 300 frames to a rosbag (see code snippet below) without any GUI being active.

      This recording was also capped at 15 FPS (the recording takes 20 seconds instead of 10 s).

      To minimize possible CPU overhead I've tried disabling the LZ4 compression but this didn't help either, the recording was still max 15 FPS.

      The SSD should support writing 1080p @ 30 FPS (when compression was disabled recording @15 FPS was no problem).

       

      So I'm wondering what could be the issue/ bottleneck that the camera only records/ streams at 15 FPS (and also not a little bit higher like 20 or 25 FPS).

       

      Kind regards

       

       

      int main(int argc, char * argv[])try

      {

       

           //Create a context and get the first device

           rs2::context ctx;

           auto devices = ctx.query_devices();

           if (devices.size() > 0)

           {

                //Create a rs2::recorder from the first device, and desired file name

                //'.bag' is the common extension for rosbag files

                rs2::recorder device("my_file_name.bag", devices[0]);

                //recorder "is a" device, so just use it like any other device now

           }

           rs2::pipeline pipe;

       

           std::cout << "Start recording" << std::endl;

           rs2::config cfg;

           cfg.enable_record_to_file("output.bag");

       

           //Create a configuration for configuring the pipeline with a non default profile

           cfg.enable_stream(RS2_STREAM_COLOR, 1920, 1080, RS2_FORMAT_YUYV, 30);

       

           pipe.start(cfg); //File will be opened in write mode at this point

           for (int i = 0; i < 300; i++)

           {

                auto frames = pipe.wait_for_frames();

           }

           pipe.stop(); //File will be closed at this point

           return EXIT_SUCCESS;

      }

      catch (const rs2::error & e)

      {

           std::cout << "RealSense error calling " << e.get_failed_function() << "(" << e.get_failed_args() << "):\n    " << e.what() << std::endl;

           return EXIT_FAILURE;

      }

      catch (const std::exception& e)

      {

           std::cerr << e.what() << std::endl;

           return EXIT_FAILURE;

      }