4 from sensor_msgs.msg
import CompressedImage
14 self.
cond = threading.Condition()
24 while 0 < len(self.
queue)
and len(data) + len(self.
queue[0]) < size:
25 data = data + self.
queue[0]
31 def seek(self, offset, whence):
43 self.queue.append(buf)
53 stream.add_frame(msg.data)
57 rospy.init_node(
'h264_listener')
58 rospy.Subscriber(
"/tello/image_raw/h264", CompressedImage, callback)
59 container = av.open(stream)
60 rospy.loginfo(
'main: opened')
61 for frame
in container.decode(video=0):
62 image = cv2.cvtColor(numpy.array(
63 frame.to_image()), cv2.COLOR_RGB2BGR)
64 cv2.imshow(
'Frame', image)
68 if __name__ ==
'__main__':
75 cv2.destroyAllWindows()
def seek(self, offset, whence)