Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions howdy/src/recorders/ffmpeg_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def record(self, numframes):
self.video = (
numpy
.frombuffer(stream, numpy.uint8)
.reshape([-1, self.width, self.height, 3])
.reshape([-1, self.height, self.width, 3])
)

def read(self):
Expand All @@ -105,10 +105,10 @@ def read(self):
self.init_camera = False
self.video = ()
self.record(self.numframes)
return 0, self.video
return 1, self.video[0]

# If we are called and self.video is empty, we should record self.numframes to fill the video buffer
if self.video == ():
if isinstance(self.video, tuple):
self.record(self.numframes)

# If we've read max frames, but still are being requested to read more, we simply record another batch.
Expand All @@ -122,7 +122,7 @@ def read(self):
self.num_frames_read += 1

# Return a single frame of video
return 0, self.video[self.num_frames_read]
return 1, self.video[self.num_frames_read]

def release(self):
""" Empty our array. If we had a hold on the camera, we would give it back here. """
Expand Down