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: 6 additions & 2 deletions pims/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,14 @@ def export_pyav(sequence, filename, rate=30, bitrate=None,
output.mux(packet)

# Finish encoding the stream
try:
from av import FFmpegError as AVError
except ImportError:
from av import AVError
while True:
try:
packet = stream.encode()
except av.AVError: # End of file raises AVError since after av 0.4
except AVError: # End of file raises AVError since after av 0.4
break
if packet is None:
break
Expand Down Expand Up @@ -499,7 +503,7 @@ def _to_rgb_uint8(image, autoscale):
color_axis = shape.index(3)
image = np.rollaxis(image, color_axis, 3)
elif image.ndim == 3 and shape.count(4) == 1:
# This is an RGBA image. Ensure that the color axis is axis 2, and
# This is an RGBA image. Ensure that the color axis is axis 2, and
# drop the A values.
color_axis = shape.index(4)
image = np.rollaxis(image, color_axis, 3)[:, :, :3]
Expand Down
Loading