Module ImportFrom alias alias alias alias Import alias Import alias Import alias identifier ImportFrom alias ImportFrom alias TryExcept body Import alias handlers ExceptHandler type NameLoad body Assign NameStore NameLoad FunctionDef arguments args defaults body TryExcept body Import alias ImportFrom alias handlers ExceptHandler type NameLoad body Return NameLoad orelse Return NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Return BinOpBitOr Set Str Str Str Call AttributeLoad Call NameLoad NameLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body If CompareIsNot NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad orelse Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr ListComp Call NameLoad Call AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore SubscriptLoad ListComp NameLoad comprehension NameStore AttributeLoad NameLoad attr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num Assign AttributeStore NameLoad attr TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Delete NameDel Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Call AttributeLoad Call NameLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword Str Expr Call AttributeLoad NameLoad attr NameLoad If CompareEq NameLoad Num body Assign NameStore NameLoad orelse Assign NameStore BinOpSub NameLoad SubscriptLoad AttributeLoad NameLoad attr Index BinOpSub NameLoad Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad If CompareNotEq AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad Call AttributeLoad NameLoad attr attr Return Call NameLoad Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr AttributeLoad NameLoad attr keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareEq NameLoad AttributeLoad NameLoad attr body Return If CompareLt NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr While CompareLt AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad Call NameLoad AttributeLoad NameLoad attr attr AugAssignAdd AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Raise Call NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Call AttributeLoad Str attr keyword AttributeLoad NameLoad attr keyword Call NameLoad NameLoad keyword AttributeLoad NameLoad attr decorator_list decorator_list
N/A __future__ absolute_import division print_function unicode_literals N/A six N/A re N/A numpy np pims.base_frames FramesSequence pims.frame Frame N/A N/A N/A av N/A N/A N/A ImportError N/A N/A av None available N/A N/A N/A N/A N/A N/A N/A av PIL Image N/A N/A N/A ImportError N/A N/A False N/A N/A True N/A PyAVVideoReader N/A FramesSequence N/A N/A Read images from the frames of a standard video file into an
    iterable object that returns images as numpy arrays.

    Parameters
    ----------
    filename : string
    process_func : function, optional
        callable with signalture `proc_img = process_func(img)`,
        which will be applied to the data from each frame
    dtype : numpy datatype, optional
        Image arrays will be converted to this datatype.
    as_grey : boolean, optional
        Convert color images to greyscale. False by default.
        May not be used in conjection with process_func.

    Examples
    --------
    >>> video = Video('video.avi')  # or .mov, etc.
    >>> imshow(video[0]) # Show the first frame.
    >>> imshow(video[-1]) # Show the last frame.
    >>> imshow(video[1][0:10, 0:10]) # Show one corner of the second frame.

    >>> for frame in video[:]:
    ...    # Do something with every frame.

    >>> for frame in video[10:20]:
    ...    # Do something with frames 10-20.

    >>> for frame in video[[5, 7, 13]]:
    ...    # Do something with frames 5, 7, and 13.

    >>> frame_count = len(video) # Number of frames in video
    >>> frame_shape = video.frame_shape # Pixel dimensions of video
     class_exts N/A N/A cls N/A N/A N/A N/A N/A mov avi mp4 N/A N/A N/A super PyAVVideoReader cls class_exts N/A classmethod __init__ N/A N/A self filename process_func dtype as_grey N/A None None False N/A N/A N/A dtype None N/A N/A N/A self _dtype dtype N/A N/A N/A self _dtype N/A np uint8 N/A N/A self filename N/A str filename N/A N/A N/A self _initialize N/A N/A N/A self _validate_process_func process_func N/A N/A N/A self _as_grey as_grey process_func N/A _initialize N/A N/A self N/A N/A N/A Scan through and tabulate contents to enable random access. N/A container N/A N/A av open N/A self filename N/A N/A self _toc N/A N/A np cumsum N/A N/A len N/A N/A packet decode N/A packet N/A N/A container demux N/A N/A self _len N/A N/A self _toc N/A -1 N/A video_stream N/A N/A s N/A s N/A container streams N/A isinstance s N/A N/A av video VideoStream N/A 0 N/A N/A self _im_sz N/A N/A video_stream width N/A video_stream height 3 N/A container N/A N/A N/A self _load_fresh_file N/A _load_fresh_file N/A N/A self N/A N/A N/A N/A self _demuxed_container N/A N/A N/A N/A av open N/A self filename demux N/A N/A self _current_packet N/A N/A N/A next N/A self _demuxed_container decode N/A N/A self _packet_cursor 0 N/A N/A self _frame_cursor 0 N/A __len__ N/A N/A self N/A N/A N/A N/A self _len N/A frame_shape N/A N/A self N/A N/A N/A N/A self _im_sz N/A property get_frame N/A N/A self j N/A N/A N/A packet_no N/A N/A N/A self _toc searchsorted j side right N/A N/A N/A self _seek_packet packet_no N/A N/A packet_no 0 N/A N/A loc j N/A N/A loc N/A j N/A N/A self _toc N/A N/A packet_no 1 N/A frame N/A N/A self _current_packet N/A loc N/A N/A N/A frame index j N/A N/A N/A AssertionError Seeking failed to obtain the correct frame. N/A result N/A N/A np asarray N/A N/A N/A N/A frame to_rgb to_image N/A N/A Frame N/A N/A N/A N/A self process_func result astype N/A self _dtype frame_no j N/A _seek_packet N/A N/A self packet_no N/A N/A N/A Advance through the container generator until we get the packet
        we want. Store that packet in self._current_packet. N/A N/A packet_no N/A self _packet_cursor N/A N/A N/A N/A packet_no N/A self _packet_cursor N/A N/A N/A N/A self _load_fresh_file N/A N/A N/A self _packet_cursor packet_no N/A N/A N/A self _current_packet N/A N/A N/A next N/A self _demuxed_container decode N/A N/A self _packet_cursor 1 N/A pixel_type N/A N/A self N/A N/A N/A N/A NotImplemented N/A property __repr__ N/A N/A self N/A N/A N/A N/A N/A <Frames>
Source: {filename}
Length: {count} frames
Frame Shape: {frame_shape!r}
 format frame_shape N/A self frame_shape count N/A len self filename N/A self filename N/A N/A