3 Replies Latest reply on Feb 12, 2018 10:43 AM by Intel Corporation

    How to get D415 TRUE-RAW stream?




      I'm using D415 Camera and I try to get RAW stream from each cam (rgb, ir-left, ir-right).


      I read this documents, and I know how to get data stream for each camera. like below code.

      (RGB - BGRA8, BGR8, Y16 ... / Infrared left&right - Y16, Y8)


      sensors = device.query_sensors();
      stereoSensor = sensors[0];
      stereoSensor.start([&](rs2::frame f) {m_ir2_FrameQueue.enqueue(f); });



      But I want RAW-Stream, not as formatted(Y16, Y8, RGB8... etc) data.



      how can i do this?

        • 1. Re: How to get D415 TRUE-RAW stream?

          The link below has a script with a list of image formats on lines 54 to 74.  RAW10 is referred to by the term RS2_FORMAT_RAW10.


          librealsense/rs_sensor.h at 5e73f7bb906a3cbec8ae43e888f182cc56c18692 · IntelRealSense/librealsense · GitHub


          My research indicates that the instructions would look something like this:


          RAW10 COLOR

          { RS2_STREAM_COLOR, RS2_FORMAT_RAW10, width, height, 0 },


          RAW10 INFRARED

          { RS2_STREAM_INFRARED, RS2_FORMAT_RAW10, width, height, 0 },


          RAW10 DEPTH

          { RS2_STREAM_DEPTH, RS2_FORMAT_RAW10, width, height, 0 },


          More complex use of these instructions can be found in the script below, from line 635 onwards down to the end of the script.


          librealsense/image.cpp at master · IntelRealSense/librealsense · GitHub

          1 of 2 people found this helpful
          • 2. Re: How to get D415 TRUE-RAW stream?

            NO, the first answer is not the solution. Even though RS2_FORMAT_RAW10 is specified in rs2_format, the following code throws an exception. (which marked X)


            config cfg;  
            //cfg.enable_stream(RS2_STREAM_INFRARED, 1, 1920, 1080, RS2_FORMAT_RAW16, 0); X  
            //cfg.enable_stream(RS2_STREAM_INFRARED, 1, 1920, 1080, RS2_FORMAT_RAW10); X  
            //cfg.enable_stream(RS2_STREAM_INFRARED, 1920, 1080, RS2_FORMAT_RAW10); X  
            //cfg.enable_stream(RS2_STREAM_COLOR, 1920, 1080, RS2_FORMAT_RAW10); X  
            //cfg.enable_stream(RS2_STREAM_COLOR, 1920, 1080, RS2_FORMAT_RAW16); O  
            //cfg.enable_stream(RS2_STREAM_INFRARED, 1920, 1080, RS2_FORMAT_RAW16); X  
            pipeline pipe;  
            pipeline_profile profile = pipe.start(cfg);  
            frameset frames = pipe.wait_for_frames();  


            In my research, Sensor has there own unique stream format which is predetermined.


            Color Stream - RAW16/Y16/BGRA8/RGBA8/BGR8/RGB8/YUYV (*and also only FHD resolution can use RAW16 )

            Infrared Stream 0 - UYVY/Y16/BGRA8/RGBA8/BGR8/RGB8

            Infrared Stream 1&2 - Y16/Y8 (* Y16 only can use in [FHD resolution X 25,15 fps] and [960x540 X 25,15 fps])

            Depth Stream - Z16 only


            Maybe your second answer could be a solution, but there is very little sample code....

            • 3. Re: How to get D415 TRUE-RAW stream?
              Intel Corporation
              This message was posted on behalf of Intel Corporation

              Hello njsnacker,

              The RAW format is not exposed to end users. To view all supported stream formats for each sensor use the command:

              rs-enumerate-devices -m 

              We have submitted this request for support to the engineering team but we cannot say if and when it will be implemented.

              Intel Customer Support