Module ImportFrom alias alias alias alias Import alias Import alias Import alias identifier Import alias Import alias Import alias identifier ImportFrom alias ImportFrom alias TryExcept body ImportFrom alias handlers ExceptHandler type NameLoad body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam defaults body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr ListLoad NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr handlers ExceptHandler body Return NameLoad orelse Return NameLoad decorator_list Assign NameStore ListLoad Str Str Assign NameStore NameLoad For NameStore NameLoad body If Call NameLoad NameLoad body Assign NameStore NameLoad Break FunctionDef arguments args defaults body Return CompareIsNot NameLoad NameLoad decorator_list Assign NameStore Dict Str Str Num Num ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad TryExcept body Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index NameLoad handlers ExceptHandler type NameLoad body Raise Call NameLoad Str Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BinOpMult BinOpMult AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Str attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Str attr AttributeLoad NameLoad attr Assign NameStore ListLoad NameLoad Str AttributeLoad NameLoad attr Str Str Str AttributeLoad NameLoad attr Str Str Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Expr Call NameLoad Str If BoolOpAnd Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad body Expr Call NameLoad Str Assign AttributeStore NameLoad attr Call NameLoad NameLoad Str Assign AttributeStore NameLoad attr Call NameLoad NameLoad Str Assign AttributeStore NameLoad attr Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr ListLoad NameLoad NameLoad Return Assign AttributeStore NameLoad attr Call NameLoad NameLoad Str Assign AttributeStore NameLoad attr Call NameLoad NameLoad Str Expr Call NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore BinOpPow Num Num While NameLoad body TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If CompareEq Call NameLoad NameLoad Num body Break Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad handlers ExceptHandler type NameLoad body Break Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Call NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr For NameStore TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body If NameLoad body Expr Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr If CompareIn Str SubscriptLoad NameLoad Index Num body Raise Call NameLoad BinOpMod Str AttributeLoad NameLoad attr Assign NameStore SubscriptLoad ListComp NameLoad comprehension NameStore NameLoad CompareIn Str NameLoad Index Num Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad Call AttributeLoad SubscriptLoad NameLoad Slice Call AttributeLoad NameLoad attr BinOpSub Call AttributeLoad NameLoad attr Num attr Str Assign AttributeStore NameLoad attr Call NameLoad SubscriptLoad Call AttributeLoad SubscriptLoad NameLoad Index Num attr Index Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad Str attr SubscriptLoad AttributeLoad NameLoad attr Index Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad Str attr SubscriptLoad AttributeLoad NameLoad attr Index Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr 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 Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMult AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad keyword Str attr TupleLoad NameLoad NameLoad AttributeLoad NameLoad attr Return Call NameLoad Call AttributeLoad NameLoad attr NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Raise Call NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Call NameLoad ListLoad Str Str Str 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 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 subprocess sp N/A sys N/A os N/A numpy np pims.base_frames FramesSequence pims.frame Frame N/A N/A subprocess DEVNULL N/A N/A N/A ImportError N/A N/A DEVNULL N/A open N/A os devnull wb try_ffmpeg N/A N/A FFMPEG_BINARY N/A N/A N/A N/A N/A proc N/A N/A sp Popen N/A FFMPEG_BINARY stdout N/A sp PIPE stderr N/A sp PIPE N/A N/A N/A proc wait N/A N/A N/A N/A False N/A N/A True N/A N/A FFMPEG_BINARY_SUGGESTIONS N/A ffmpeg ffmpeg.exe N/A FFMPEG_BINARY None N/A name FFMPEG_BINARY_SUGGESTIONS N/A N/A N/A try_ffmpeg name N/A N/A FFMPEG_BINARY name N/A available N/A N/A N/A N/A N/A N/A FFMPEG_BINARY None N/A N/A _pix_fmt_dict N/A rgb24 rgba 3 4 FFmpegVideoReader 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.

    This reader, based on ffmpeg, should be able to read most video
    files

    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 = FFmpegVideoReader('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

     __init__ N/A N/A self filename process_func pix_fmt use_cache as_grey N/A None rgb24 True False N/A N/A N/A self filename filename N/A N/A self pix_fmt pix_fmt N/A N/A N/A self _initialize use_cache N/A N/A N/A N/A self depth N/A _pix_fmt_dict N/A pix_fmt N/A N/A N/A KeyError N/A N/A N/A ValueError invalid pixel format N/A N/A w h N/A self _size N/A N/A self _stride N/A N/A N/A self depth w h 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 use_cache N/A N/A N/A  Opens the file, creates the pipe.  N/A buffer_filename N/A N/A {0}.pims_buffer format N/A self filename N/A meta_filename N/A N/A {0}.pims_meta format N/A self filename N/A cmd N/A FFMPEG_BINARY -i N/A self filename -f image2pipe -pix_fmt N/A self pix_fmt -vcodec rawvideo - N/A proc N/A N/A sp Popen cmd stdin N/A sp PIPE stdout N/A sp PIPE stderr N/A sp PIPE N/A N/A print Decoding video file... N/A N/A N/A N/A N/A os path isfile buffer_filename N/A N/A N/A os path isfile meta_filename use_cache N/A N/A N/A print Reusing buffer from previous opening of this video. N/A N/A self data_buffer N/A open buffer_filename rb N/A N/A self metafile N/A open meta_filename r N/A N/A self _len N/A int N/A N/A N/A self metafile readline N/A w N/A int N/A N/A N/A self metafile readline N/A h N/A int N/A N/A N/A self metafile readline N/A N/A self _size N/A w h N/A N/A N/A self data_buffer N/A open buffer_filename wb N/A N/A self metafile N/A open meta_filename w N/A N/A print Decoding video file. This is slow, but only the first time. N/A N/A N/A N/A sys stdout flush N/A CHUNKSIZE N/A 2 14 N/A True N/A N/A N/A N/A chunk N/A N/A N/A proc stdout read CHUNKSIZE N/A N/A N/A len chunk 0 N/A N/A N/A N/A N/A N/A self data_buffer write chunk N/A N/A N/A EOFError N/A N/A N/A N/A N/A N/A self data_buffer close N/A N/A self data_buffer N/A open buffer_filename rb N/A N/A N/A self _process_ffmpeg_stderr N/A N/A N/A proc stderr read N/A N/A N/A proc terminate N/A std N/A N/A proc stdin N/A proc stdout N/A proc stderr N/A N/A N/A N/A std close N/A _process_ffmpeg_stderr N/A N/A self stderr verbose N/A False N/A N/A verbose N/A N/A N/A print stderr N/A lines N/A N/A stderr splitlines N/A N/A No such file or directory N/A lines N/A -1 N/A N/A N/A IOError N/A %s not found ! Wrong path ? N/A self filename N/A line N/A N/A l N/A l lines N/A  Video:  l N/A 0 N/A match N/A N/A re search  [0-9]*x[0-9]*(,| ) line N/A N/A self _size N/A map int N/A N/A N/A line N/A N/A N/A match start N/A N/A N/A match end 1 split x N/A N/A self _len N/A int N/A N/A N/A N/A lines N/A -2 split N/A 1 N/A N/A N/A N/A self metafile write N/A N/A {0}
 format N/A self _len N/A N/A N/A N/A self metafile write N/A N/A {0}
 format N/A N/A self _size N/A 0 N/A N/A N/A N/A self metafile write N/A N/A {0}
 format N/A N/A self _size N/A 1 N/A N/A N/A N/A self metafile close 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 _size N/A property get_frame N/A N/A self j N/A N/A N/A N/A N/A N/A self data_buffer seek N/A N/A self _stride j N/A s N/A N/A N/A self data_buffer read N/A self _stride N/A N/A w h N/A self _size N/A result N/A N/A N/A N/A np fromstring s dtype uint8 reshape N/A h w N/A self depth N/A N/A Frame N/A N/A self process_func result frame_no j N/A pixel_type N/A N/A self N/A N/A N/A N/A NotImplemented N/A property class_exts N/A N/A cls N/A N/A N/A N/A set N/A mov avi webm N/A classmethod __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}
Pixel Format: {pix_fmt} format frame_shape N/A self frame_shape count N/A len self filename N/A self filename pix_fmt N/A self pix_fmt N/A N/A