Skip to content

Commit

Permalink
v1.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Lijun-Yu committed Oct 21, 2020
1 parent a627b5c commit bb67660
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
9 changes: 5 additions & 4 deletions avi_r/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
class AVIReader(object):

def __init__(self, video_path: str, parent_dir: str = '',
fix_missing: bool = True, silence_warning: bool = True):
fix_missing: bool = True, silence_warning: bool = True,
**kwargs):
"""Read frames from a video file.
Parameters
Expand Down Expand Up @@ -57,7 +58,7 @@ def __init__(self, video_path: str, parent_dir: str = '',
self.fix_missing = fix_missing
if not self.fix_missing:
self._logger.warning('NOT fixing missing frames.')
self._init()
self._init(**kwargs)
self.num_frames = self._stream.duration
self.frame_rate = float(self._stream.average_rate)
self.height = self._stream.codec_context.height
Expand Down Expand Up @@ -229,9 +230,9 @@ def __del__(self):
if hasattr(self, '_container'):
self._del()

def _init(self, video_stream_id=0):
def _init(self, video_stream_id=0, timeout=None):
self._container = av.open(
self.path, metadata_errors='replace', timeout=60)
self.path, metadata_errors='replace', timeout=timeout)
self._stream = self._container.streams.video[video_stream_id]
self._frame_gen = self._get_frame_gen()
self.reorder_buffer = []
Expand Down
5 changes: 5 additions & 0 deletions docs/version.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Version History

## AVI-R v1.3.7

* Remove default timeout.
* Bypass kwargs to _init.

## AVI-R v1.3.6

* Add timeout for PyAV.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setuptools.setup(
name='avi-r',
version='1.3.6',
version='1.3.7',
author='Lijun Yu',
author_email='lijun@lj-y.com',
description='A robust reader for avi videos.',
Expand Down

0 comments on commit bb67660

Please sign in to comment.