title: Frame didn't arrived within 5000 while reading .bag file - pyrealsense2
body: <p>I'm trying to read the frames in the <code>.bag</code> files with <code>pyrealsense2</code>. I followed the <a href="https://github.com/IntelRealSense/librealsense/blob/master/wrappers/python/examples/read_bag_example.py" rel="nofollow noreferrer">read_bag_example</a> by Intel. Here's the full sample that the code that I'm using.</p>
  
  <pre><code>import numpy as np
  import pyrealsense2 as rs
  import os
  import time
  import cv2
  
  i = 0
  try:
      config = rs.config()
      rs.config.enable_device_from_file(config, "D:/TEST/test_4.bag", repeat_playback=False)
      pipeline = rs.pipeline()
      pipeline.start(config)
  
      while True:
          frames = pipeline.wait_for_frames()
          depth_frame = frames.get_depth_frame()
          if not depth_frame:
              continue
          depth_image = np.asanyarray(depth_frame.get_data())
  
          color_image = cv2.applyColorMap(cv2.convertScaleAbs(depth_image, alpha=0.03), cv2.COLORMAP_JET)
  
          cv2.imwrite("D:/TEST/image/" + str(i) + ".png", color_image)
          i += 1
  finally:
      pass
  </code></pre>
  
  <p>The code is working. However I checked the number of frames via <code>realsense-viewer</code> and its output is <strong>890</strong> frames. However, the output of this code always changes in the <strong>range of 500-770</strong> and raise the error:</p>
  
  <blockquote>
    <p>RuntimeError: Frame didn't arrived within 5000</p>
  </blockquote>
  
  <p>I searched lots of hours but I was not able to find a solution that would resolve my problem. </p>
  
  <p>I'm also using</p>
  
  <ul>
  <li>Intel Firmware version - 5.11.15.0</li>
  <li>Python - 3.6.8</li>
  <li>pyrealsense2 - 2.24.0.965</li>
  <li>D435 with <strong>848x480, 90 FPS</strong> images  </li>
  </ul>
  
  <p>I could add more information if you need. Any help or other suggestions would greatly appriciated!</p>