2 Replies Latest reply on Jun 15, 2018 8:49 AM by Intel Corporation

    Save Frames For Future Use (UYVY Format)

    harmonic

      I'm currently trying to sample a set of frames using the UYVY format. As I sample I push them back into a vector. If I try to add more than 10 elements to this vector, librealsense2 throws an exception which terminates the program. Sample code shown below.

       

      framesVec.PNG

       

      Strangely I only have this issue when trying to save using the UYVY format, it seems to work fine using the Y8 format. Originally I had this same issue for saving in any format but the .keep() function resolved it. In the viewer the UYVY format is supported for a single IR sensor; however in order to enable it I must use cfg.enable_stream(RS2_STREAM_INFRARED, -1, 1280, 720, RS2_FORMAT_UYVY, 30);   Specifying an index other than "-1" results in a thrown exception. When attempting to retrieve frames using .get_infrared_frame(), specifying an index (e.g. 1 or 2) returns a NULL pointer rather than a frame.

       

      To summarize, I am retrieving frames, but cannot hold on to more than 10 at a time, using standard stl containers, and ".keep()" does not resolve the issue. As I am able to sample and save large quantities of frames in other formats (e.g. 500 rgb frames in 24bit rgb) I am confident I am not running out of memory. Anyone have any ideas ?

        • 1. Re: Save Frames For Future Use (UYVY Format)
          caryPai

          Hello,

           

          I use 2.11.0 LibRS and revised rs-capture.cpp sample code to simulate your situation, the code works without problem, please have a try and let me know your feedback.

           

           

          Also for index of the Left/Right IR, Y8 & Y16 are generated from each stream so if you want to get those two format, you can set stream parameter to 1 or 2. But few of the format is generated through software, if you want to retrieve those format, you have to set the index to 0. you can use the rs-sensor-control.cpp example to list down the available streams. Attached my enumeration from the sample.

           

          Sensor provides the following stream profiles:

          0  : Infrared #2 (Video Stream: Y16 1920x1080@ 25Hz)

          1  : Infrared #1 (Video Stream: Y16 1920x1080@ 25Hz)

          2  : Infrared #1 (Video Stream: Y8 1920x1080@ 25Hz)

          3  : Infrared #2 (Video Stream: Y8 1920x1080@ 25Hz)

          4  : Infrared #2 (Video Stream: Y16 1920x1080@ 15Hz)

          5  : Infrared #1 (Video Stream: Y16 1920x1080@ 15Hz)

          6  : Infrared #1 (Video Stream: Y8 1920x1080@ 15Hz)

          7  : Infrared #2 (Video Stream: Y8 1920x1080@ 15Hz)

          8  : Infrared #0 (Video Stream: UYVY 1280x720@ 30Hz)

          9  : Infrared #1 (Video Stream: Y8 1280x720@ 30Hz)

          10 : Infrared #2 (Video Stream: Y8 1280x720@ 30Hz)

          11 : Infrared #0 (Video Stream: BGRA8 1280x720@ 30Hz)

          12 : Infrared #0 (Video Stream: RGBA8 1280x720@ 30Hz)

          13 : Infrared #0 (Video Stream: BGR8 1280x720@ 30Hz)

          14 : Infrared #0 (Video Stream: RGB8 1280x720@ 30Hz)

          15 : Infrared #0 (Video Stream: UYVY 1280x720@ 15Hz)

          16 : Infrared #1 (Video Stream: Y8 1280x720@ 15Hz)

          17 : Infrared #2 (Video Stream: Y8 1280x720@ 15Hz)

          18 : Infrared #0 (Video Stream: BGRA8 1280x720@ 15Hz)

          19 : Infrared #0 (Video Stream: RGBA8 1280x720@ 15Hz)

          20 : Infrared #0 (Video Stream: BGR8 1280x720@ 15Hz)

          21 : Infrared #0 (Video Stream: RGB8 1280x720@ 15Hz)

          22 : Infrared #0 (Video Stream: UYVY 1280x720@ 6Hz)

          23 : Infrared #2 (Video Stream: Y8 1280x720@ 6Hz)

          24 : Infrared #1 (Video Stream: Y8 1280x720@ 6Hz)

          25 : Infrared #0 (Video Stream: BGRA8 1280x720@ 6Hz)

          26 : Infrared #0 (Video Stream: RGBA8 1280x720@ 6Hz)

          27 : Infrared #0 (Video Stream: BGR8 1280x720@ 6Hz)

          28 : Infrared #0 (Video Stream: RGB8 1280x720@ 6Hz)

          29 : Infrared #2 (Video Stream: Y16 960x540@ 25Hz)

          30 : Infrared #1 (Video Stream: Y16 960x540@ 25Hz)

          31 : Infrared #1 (Video Stream: Y16 960x540@ 15Hz)

          32 : Infrared #2 (Video Stream: Y16 960x540@ 15Hz)

          33 : Infrared #0 (Video Stream: UYVY 848x480@ 90Hz)

          34 : Infrared #1 (Video Stream: Y8 848x480@ 90Hz)

          35 : Infrared #2 (Video Stream: Y8 848x480@ 90Hz)

          36 : Infrared #0 (Video Stream: BGRA8 848x480@ 90Hz)

          37 : Infrared #0 (Video Stream: RGBA8 848x480@ 90Hz)

          38 : Infrared #0 (Video Stream: BGR8 848x480@ 90Hz)

          39 : Infrared #0 (Video Stream: RGB8 848x480@ 90Hz)

          40 : Infrared #0 (Video Stream: UYVY 848x480@ 60Hz)

          41 : Infrared #2 (Video Stream: Y8 848x480@ 60Hz)

          42 : Infrared #1 (Video Stream: Y8 848x480@ 60Hz)

          43 : Infrared #0 (Video Stream: BGRA8 848x480@ 60Hz)

          44 : Infrared #0 (Video Stream: RGBA8 848x480@ 60Hz)

          45 : Infrared #0 (Video Stream: BGR8 848x480@ 60Hz)

          46 : Infrared #0 (Video Stream: RGB8 848x480@ 60Hz)

          47 : Infrared #0 (Video Stream: UYVY 848x480@ 30Hz)

          48 : Infrared #1 (Video Stream: Y8 848x480@ 30Hz)

          49 : Infrared #2 (Video Stream: Y8 848x480@ 30Hz)

          50 : Infrared #0 (Video Stream: BGRA8 848x480@ 30Hz)

          51 : Infrared #0 (Video Stream: RGBA8 848x480@ 30Hz)

          52 : Infrared #0 (Video Stream: BGR8 848x480@ 30Hz)

          53 : Infrared #0 (Video Stream: RGB8 848x480@ 30Hz)

          54 : Infrared #0 (Video Stream: UYVY 848x480@ 15Hz)

          55 : Infrared #1 (Video Stream: Y8 848x480@ 15Hz)

          56 : Infrared #2 (Video Stream: Y8 848x480@ 15Hz)

          57 : Infrared #0 (Video Stream: BGRA8 848x480@ 15Hz)

          58 : Infrared #0 (Video Stream: RGBA8 848x480@ 15Hz)

          59 : Infrared #0 (Video Stream: BGR8 848x480@ 15Hz)

          60 : Infrared #0 (Video Stream: RGB8 848x480@ 15Hz)

          61 : Infrared #0 (Video Stream: UYVY 848x480@ 6Hz)

          62 : Infrared #1 (Video Stream: Y8 848x480@ 6Hz)

          63 : Infrared #2 (Video Stream: Y8 848x480@ 6Hz)

          64 : Infrared #0 (Video Stream: BGRA8 848x480@ 6Hz)

          65 : Infrared #0 (Video Stream: RGBA8 848x480@ 6Hz)

          66 : Infrared #0 (Video Stream: BGR8 848x480@ 6Hz)

          67 : Infrared #0 (Video Stream: RGB8 848x480@ 6Hz)

          68 : Infrared #0 (Video Stream: UYVY 640x480@ 90Hz)

          69 : Infrared #1 (Video Stream: Y8 640x480@ 90Hz)

          70 : Infrared #2 (Video Stream: Y8 640x480@ 90Hz)

          71 : Infrared #0 (Video Stream: BGRA8 640x480@ 90Hz)

          72 : Infrared #0 (Video Stream: RGBA8 640x480@ 90Hz)

          73 : Infrared #0 (Video Stream: BGR8 640x480@ 90Hz)

          74 : Infrared #0 (Video Stream: RGB8 640x480@ 90Hz)

          75 : Infrared #0 (Video Stream: UYVY 640x480@ 60Hz)

          76 : Infrared #2 (Video Stream: Y8 640x480@ 60Hz)

          77 : Infrared #1 (Video Stream: Y8 640x480@ 60Hz)

          78 : Infrared #0 (Video Stream: BGRA8 640x480@ 60Hz)

          79 : Infrared #0 (Video Stream: RGBA8 640x480@ 60Hz)

          80 : Infrared #0 (Video Stream: BGR8 640x480@ 60Hz)

          81 : Infrared #0 (Video Stream: RGB8 640x480@ 60Hz)

          82 : Infrared #0 (Video Stream: UYVY 640x480@ 30Hz)

          83 : Infrared #2 (Video Stream: Y8 640x480@ 30Hz)

          84 : Infrared #1 (Video Stream: Y8 640x480@ 30Hz)

          85 : Infrared #0 (Video Stream: BGRA8 640x480@ 30Hz)

          86 : Infrared #0 (Video Stream: RGBA8 640x480@ 30Hz)

          87 : Infrared #0 (Video Stream: BGR8 640x480@ 30Hz)

          88 : Infrared #0 (Video Stream: RGB8 640x480@ 30Hz)

          89 : Infrared #0 (Video Stream: UYVY 640x480@ 15Hz)

          90 : Infrared #1 (Video Stream: Y8 640x480@ 15Hz)

          91 : Infrared #2 (Video Stream: Y8 640x480@ 15Hz)

          92 : Infrared #0 (Video Stream: BGRA8 640x480@ 15Hz)

          93 : Infrared #0 (Video Stream: RGBA8 640x480@ 15Hz)

          94 : Infrared #0 (Video Stream: BGR8 640x480@ 15Hz)

          95 : Infrared #0 (Video Stream: RGB8 640x480@ 15Hz)

          96 : Infrared #0 (Video Stream: UYVY 640x480@ 6Hz)

          97 : Infrared #1 (Video Stream: Y8 640x480@ 6Hz)

          98 : Infrared #2 (Video Stream: Y8 640x480@ 6Hz)

          99 : Infrared #0 (Video Stream: BGRA8 640x480@ 6Hz)

          100: Infrared #0 (Video Stream: RGBA8 640x480@ 6Hz)

          101: Infrared #0 (Video Stream: BGR8 640x480@ 6Hz)

          102: Infrared #0 (Video Stream: RGB8 640x480@ 6Hz)

          103: Infrared #0 (Video Stream: UYVY 640x360@ 90Hz)

          104: Infrared #2 (Video Stream: Y8 640x360@ 90Hz)

          105: Infrared #1 (Video Stream: Y8 640x360@ 90Hz)

          106: Infrared #0 (Video Stream: BGRA8 640x360@ 90Hz)

          107: Infrared #0 (Video Stream: RGBA8 640x360@ 90Hz)

          108: Infrared #0 (Video Stream: BGR8 640x360@ 90Hz)

          109: Infrared #0 (Video Stream: RGB8 640x360@ 90Hz)

          110: Infrared #0 (Video Stream: UYVY 640x360@ 60Hz)

          111: Infrared #1 (Video Stream: Y8 640x360@ 60Hz)

          112: Infrared #2 (Video Stream: Y8 640x360@ 60Hz)

          113: Infrared #0 (Video Stream: BGRA8 640x360@ 60Hz)

          114: Infrared #0 (Video Stream: RGBA8 640x360@ 60Hz)

          115: Infrared #0 (Video Stream: BGR8 640x360@ 60Hz)

          116: Infrared #0 (Video Stream: RGB8 640x360@ 60Hz)

          117: Infrared #0 (Video Stream: UYVY 640x360@ 30Hz)

          118: Infrared #1 (Video Stream: Y8 640x360@ 30Hz)

          119: Infrared #2 (Video Stream: Y8 640x360@ 30Hz)

          120: Infrared #0 (Video Stream: BGRA8 640x360@ 30Hz)

          121: Infrared #0 (Video Stream: RGBA8 640x360@ 30Hz)

          122: Infrared #0 (Video Stream: BGR8 640x360@ 30Hz)

          123: Infrared #0 (Video Stream: RGB8 640x360@ 30Hz)

          124: Infrared #0 (Video Stream: UYVY 640x360@ 15Hz)

          125: Infrared #2 (Video Stream: Y8 640x360@ 15Hz)

          126: Infrared #1 (Video Stream: Y8 640x360@ 15Hz)

          127: Infrared #0 (Video Stream: BGRA8 640x360@ 15Hz)

          128: Infrared #0 (Video Stream: RGBA8 640x360@ 15Hz)

          129: Infrared #0 (Video Stream: BGR8 640x360@ 15Hz)

          130: Infrared #0 (Video Stream: RGB8 640x360@ 15Hz)

          131: Infrared #0 (Video Stream: UYVY 640x360@ 6Hz)

          132: Infrared #1 (Video Stream: Y8 640x360@ 6Hz)

          133: Infrared #2 (Video Stream: Y8 640x360@ 6Hz)

          134: Infrared #0 (Video Stream: BGRA8 640x360@ 6Hz)

          135: Infrared #0 (Video Stream: RGBA8 640x360@ 6Hz)

          136: Infrared #0 (Video Stream: BGR8 640x360@ 6Hz)

          137: Infrared #0 (Video Stream: RGB8 640x360@ 6Hz)

          138: Infrared #0 (Video Stream: UYVY 480x270@ 90Hz)

          139: Infrared #2 (Video Stream: Y8 480x270@ 90Hz)

          140: Infrared #1 (Video Stream: Y8 480x270@ 90Hz)

          141: Infrared #0 (Video Stream: BGRA8 480x270@ 90Hz)

          142: Infrared #0 (Video Stream: RGBA8 480x270@ 90Hz)

          143: Infrared #0 (Video Stream: BGR8 480x270@ 90Hz)

          144: Infrared #0 (Video Stream: RGB8 480x270@ 90Hz)

          145: Infrared #0 (Video Stream: UYVY 480x270@ 60Hz)

          146: Infrared #2 (Video Stream: Y8 480x270@ 60Hz)

          147: Infrared #1 (Video Stream: Y8 480x270@ 60Hz)

          148: Infrared #0 (Video Stream: BGRA8 480x270@ 60Hz)

          149: Infrared #0 (Video Stream: RGBA8 480x270@ 60Hz)

          150: Infrared #0 (Video Stream: BGR8 480x270@ 60Hz)

          151: Infrared #0 (Video Stream: RGB8 480x270@ 60Hz)

          152: Infrared #0 (Video Stream: UYVY 480x270@ 30Hz)

          153: Infrared #2 (Video Stream: Y8 480x270@ 30Hz)

          154: Infrared #1 (Video Stream: Y8 480x270@ 30Hz)

          155: Infrared #0 (Video Stream: BGRA8 480x270@ 30Hz)

          156: Infrared #0 (Video Stream: RGBA8 480x270@ 30Hz)

          157: Infrared #0 (Video Stream: BGR8 480x270@ 30Hz)

          158: Infrared #0 (Video Stream: RGB8 480x270@ 30Hz)

          159: Infrared #0 (Video Stream: UYVY 480x270@ 15Hz)

          160: Infrared #2 (Video Stream: Y8 480x270@ 15Hz)

          161: Infrared #1 (Video Stream: Y8 480x270@ 15Hz)

          162: Infrared #0 (Video Stream: BGRA8 480x270@ 15Hz)

          163: Infrared #0 (Video Stream: RGBA8 480x270@ 15Hz)

          164: Infrared #0 (Video Stream: BGR8 480x270@ 15Hz)

          165: Infrared #0 (Video Stream: RGB8 480x270@ 15Hz)

          166: Infrared #0 (Video Stream: UYVY 480x270@ 6Hz)

          167: Infrared #1 (Video Stream: Y8 480x270@ 6Hz)

          168: Infrared #2 (Video Stream: Y8 480x270@ 6Hz)

          169: Infrared #0 (Video Stream: BGRA8 480x270@ 6Hz)

          170: Infrared #0 (Video Stream: RGBA8 480x270@ 6Hz)

          171: Infrared #0 (Video Stream: BGR8 480x270@ 6Hz)

          172: Infrared #0 (Video Stream: RGB8 480x270@ 6Hz)

          173: Infrared #0 (Video Stream: UYVY 424x240@ 90Hz)

          174: Infrared #2 (Video Stream: Y8 424x240@ 90Hz)

          175: Infrared #1 (Video Stream: Y8 424x240@ 90Hz)

          176: Infrared #0 (Video Stream: BGRA8 424x240@ 90Hz)

          177: Infrared #0 (Video Stream: RGBA8 424x240@ 90Hz)

          178: Infrared #0 (Video Stream: BGR8 424x240@ 90Hz)

          179: Infrared #0 (Video Stream: RGB8 424x240@ 90Hz)

          180: Infrared #0 (Video Stream: UYVY 424x240@ 60Hz)

          181: Infrared #2 (Video Stream: Y8 424x240@ 60Hz)

          182: Infrared #1 (Video Stream: Y8 424x240@ 60Hz)

          183: Infrared #0 (Video Stream: BGRA8 424x240@ 60Hz)

          184: Infrared #0 (Video Stream: RGBA8 424x240@ 60Hz)

          185: Infrared #0 (Video Stream: BGR8 424x240@ 60Hz)

          186: Infrared #0 (Video Stream: RGB8 424x240@ 60Hz)

          187: Infrared #0 (Video Stream: UYVY 424x240@ 30Hz)

          188: Infrared #1 (Video Stream: Y8 424x240@ 30Hz)

          189: Infrared #2 (Video Stream: Y8 424x240@ 30Hz)

          190: Infrared #0 (Video Stream: BGRA8 424x240@ 30Hz)

          191: Infrared #0 (Video Stream: RGBA8 424x240@ 30Hz)

          192: Infrared #0 (Video Stream: BGR8 424x240@ 30Hz)

          193: Infrared #0 (Video Stream: RGB8 424x240@ 30Hz)

          194: Infrared #0 (Video Stream: UYVY 424x240@ 15Hz)

          195: Infrared #1 (Video Stream: Y8 424x240@ 15Hz)

          196: Infrared #2 (Video Stream: Y8 424x240@ 15Hz)

          197: Infrared #0 (Video Stream: BGRA8 424x240@ 15Hz)

          198: Infrared #0 (Video Stream: RGBA8 424x240@ 15Hz)

          199: Infrared #0 (Video Stream: BGR8 424x240@ 15Hz)

          200: Infrared #0 (Video Stream: RGB8 424x240@ 15Hz)

          201: Infrared #0 (Video Stream: UYVY 424x240@ 6Hz)

          202: Infrared #1 (Video Stream: Y8 424x240@ 6Hz)

          203: Infrared #2 (Video Stream: Y8 424x240@ 6Hz)

          204: Infrared #0 (Video Stream: BGRA8 424x240@ 6Hz)

          205: Infrared #0 (Video Stream: RGBA8 424x240@ 6Hz)

          206: Infrared #0 (Video Stream: BGR8 424x240@ 6Hz)

          207: Infrared #0 (Video Stream: RGB8 424x240@ 6Hz)

          208: Depth #0 (Video Stream: Z16 1280x720@ 30Hz)

          209: Depth #0 (Video Stream: Z16 1280x720@ 15Hz)

          210: Depth #0 (Video Stream: Z16 1280x720@ 6Hz)

          211: Depth #0 (Video Stream: Z16 848x480@ 90Hz)

          212: Depth #0 (Video Stream: Z16 848x480@ 60Hz)

          213: Depth #0 (Video Stream: Z16 848x480@ 30Hz)

          214: Depth #0 (Video Stream: Z16 848x480@ 15Hz)

          215: Depth #0 (Video Stream: Z16 848x480@ 6Hz)

          216: Depth #0 (Video Stream: Z16 640x480@ 90Hz)

          217: Depth #0 (Video Stream: Z16 640x480@ 60Hz)

          218: Depth #0 (Video Stream: Z16 640x480@ 30Hz)

          219: Depth #0 (Video Stream: Z16 640x480@ 15Hz)

          220: Depth #0 (Video Stream: Z16 640x480@ 6Hz)

          221: Depth #0 (Video Stream: Z16 640x360@ 90Hz)

          222: Depth #0 (Video Stream: Z16 640x360@ 60Hz)

          223: Depth #0 (Video Stream: Z16 640x360@ 30Hz)

          224: Depth #0 (Video Stream: Z16 640x360@ 15Hz)

          225: Depth #0 (Video Stream: Z16 640x360@ 6Hz)

          226: Depth #0 (Video Stream: Z16 480x270@ 90Hz)

          227: Depth #0 (Video Stream: Z16 480x270@ 60Hz)

          228: Depth #0 (Video Stream: Z16 480x270@ 30Hz)

          229: Depth #0 (Video Stream: Z16 480x270@ 15Hz)

          230: Depth #0 (Video Stream: Z16 480x270@ 6Hz)

          231: Depth #0 (Video Stream: Z16 424x240@ 90Hz)

          232: Depth #0 (Video Stream: Z16 424x240@ 60Hz)

          233: Depth #0 (Video Stream: Z16 424x240@ 30Hz)

          234: Depth #0 (Video Stream: Z16 424x240@ 15Hz)

          235: Depth #0 (Video Stream: Z16 424x240@ 6Hz)

          • 2. Re: Save Frames For Future Use (UYVY Format)
            Intel Corporation
            This message was posted on behalf of Intel Corporation

            Hello Harmonic,

            Did the solution above resolve your problem?

            Regards,
            Jesus G.
            Intel Customer Support