亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? mmread.m

?? mmread funtion In MATLAB code format
?? M
?? 第 1 頁 / 共 2 頁
字號:
function [video, audio] = mmread(filename, frames, time, disableVideo, disableAudio, matlabCommand, trySeeking, useFFGRAB)
% [video, audio] = mmread(filename, frames, time, disableVideo, 
%                       disableAudio, matlabCommand, trySeeking, useFFGRAB)
% mmread reads virtually any media file.  It now uses AVbin and FFmpeg to 
% capture the data, this includes URLs.  The code supports all major OSs
% and architectures that Matlab runs on.
%
% INPUT
% filename      input file to read (mpg, avi, wmv, asf, wav, mp3, gif, ...)
% frames        specifies which video frames to capture, default [] for all
%               or to specify time
% time          [startTime stopTime], default [] for all
% disableVideo  disables ALL video capturing, to save memory or time
% disableAudio  disables ALL audio capturing, to save memory or time
% matlabCommand Do not return the video structure, but call the function
%               specified by matlabCommand.  The function definition must
%               match that of processFrame.m.  See processFrame.m for more
%               information.
% trySeeking    [true] setting this to false makes the code slower but more
%               precise.  If the first several frames are distorted or
%               timing information isn't accurate, set this to false.
% useFFGRAB     [true] Use the new version of mmread, which uses ffmpeg.
%               However, if an audio or video stream can't be read AND you 
%               are running Windows try setting this to false (old version).
%
% OUTPUT
% video is a struct with the following fields:
%   width           width of the video frames
%   height          height of the video frames
%   rate            the frame rate of the video, if it can't be determined
%                   it will be 1.
%   nrFramesTotal   the total number of frames in the movie regardless of
%                   how many were captured.  Unfortunately, this can not
%                   always be determined.  If it is negative then it
%                   is an estimate based upon the duration and rate
%                   (normally accurate to within .1%).   It can be 0,
%                   in which case it could not be determined at all.  If it
%                   is a possitive number then it should always be accurate.
%   totalDuration   the total length of the video in seconds.
%   frames          a struct array with the following fields:
%       cdata       [height X width X 3] uint8 matricies
%       colormap    always empty
%   times           the corresponding time stamps for the frames (in msec)
%   skippedFrames   some codecs (not mmread) will skip duplicate frames
%                   (i.e. identical to the previous) in fixed frame rate
%                   movies to save space and time.  These skipped frames
%                   can be detected by looking for jumps in the "times"
%                   field.  This field will be true when frames are
%                   skipped.
%
% audio is a struct with the following fields:
%   nrChannels      the number of channels in the audio stream (1 or 2)
%   rate            sampling rate of the audio, ex. 44100.  If it can't be
%                   determined then it will be 1.
%   bits            bit depth of the samples (8 or 16)
%   data            the real data of the whole audio stream.  This can be
%                   played using wavplay.  If time ranges are specified,
%                   the length of the data may not correspond to the total
%                   time.  This normally happens with movies.  The issue is
%                   that the start of the audio stream is generally counted
%                   at the END of the first frame.  So, time is shifted by
%                   1/framerate.
%   nrFramesTotal   Audio comes in packets or frames when captured, the
%                   division of the audio into frames may or may not make
%                   sense.
%   totalDuration   the total length of the audio in seconds.
%   frames          cell array of uint8s.  Probably not of great use.
%   times           the corresponding time stamps for the frames (in milliseconds)
%
% If there is no video or audio stream the corresponding structure will be
% empty.
%
% Specifying frames does not effect audio capturing.  If you want only a
% subsection of the audio use the 3rd parameter "time".  Specifying time
% effects both audio and video.  Time is specified in seconds (subsecond
% resolution is supported with fractional numbers ex. 1.125), starting at 0.
% Time is defined as startTime (inclusive) to stopTime (exclusive), or
% using set notation [startTime stopTime).
%
% If there are multiple video or audio streams, then the structure will be
% of length > 1.  For example: audio(1).data and audio(2).data.
%
% EXAMPLES
% [video, audio] = mmread('chimes.wav'); % read whole wav file
% wavplay(audio.data,audio.rate);
%
% video = mmread('mymovie.mpg'); % read whole movie
% movie(video.frames);
%
% video = mmread('mymovie.mpg',1:10); %get only the first 10 frames
%
% video = mmread('mymovie.mpg',[],[0 3.5]); %read the first 3.5 seconds of the video
%
% [video, audio] = mmread('chimes.wav',[],[0 0.25]); %read the first 0.25 seconds of the wav
% [video, audio] = mmread('chimes.wav',[],[0.25 0.5]); %read 0.25 to 0.5 seconds of the wav, there is no overlap with the previous example.
%
% read a movie directly from a URL  
% video = mmread('http://www.nature.com/neuro/journal/v9/n4/extref/nn1660-S8.avi');  
%
% video = mmread('mymovie.mpg',[],[],false,true); %read all frames, disable audio
%
% mmread('mymovie.mpg',[],[],false,false,'processFrame'); %Use inline processing for all frames in a movie using the function processFrame.m
%
% Copyright 2008 Micah Richert
% 
% This file is part of mmread.
% 
% mmread is free software; you can redistribute it and/or modify it
% under the terms of the GNU Lesser General Public License as
% published by the Free Software Foundation; either version 3 of
% the License, or (at your option) any later version.
% 
% mmread is distributed WITHOUT ANY WARRANTY.  See the GNU
% General Public License for more details.
% 
% You should have received a copy of the GNU General Public
% License along with mmread.  If not, see <http://www.gnu.org/licenses/>.

if nargin < 8
    useFFGRAB = true;
    if nargin < 7
        trySeeking = true;
        if nargin < 6
            matlabCommand = '';
            if nargin < 5
                disableAudio = nargout < 2;
                if nargin < 4
                    disableVideo = false;
                    if nargin < 3
                        time = [];
                        if nargin < 2
                            frames = [];
                        end
                    end
                end
            end
        end
    end
end

if useFFGRAB
    currentdir = pwd;
    try
        if ~ispc
            cd(fileparts(mfilename('fullpath'))); % FFGrab searches for AVbin in the current directory
        end

        FFGrab('build',filename,double(disableVideo),double(disableAudio),double(trySeeking));
        
        if (isempty(time))
            FFGrab('setFrames',frames);
        else
            if (numel(time) ~= 2)
                error('time must be a vector of length 2: [startTime stopTime]');
            end
            FFGrab('setTime',time(1),time(2));
        end
        FFGrab('setMatlabCommand',matlabCommand);

        try
            FFGrab('doCapture');
        catch
            err = lasterror;
            if (~strcmp(err.identifier,'processFrame:STOP'))
                rethrow(err);
            end
        end

        [nrVideoStreams, nrAudioStreams] = FFGrab('getCaptureInfo');

        video = struct('width',{},'height',{},'nrFramesTotal',{},'frames',{});
        audio = struct('nrChannels',{},'rate',{},'bits',{},'nrFramesTotal',{},'data',{},'frames',{});

        warned = false;

        % we can only get the video frames if we don't process a matlabCommand
        if strcmp(matlabCommand,'')
            % loop through getting all of the video data from each stream
            for i=1:nrVideoStreams
                [width, height, rate, nrFramesCaptured, nrFramesTotal, totalDuration] = FFGrab('getVideoInfo',i-1);
                video(i).width = width;
                video(i).height = height;
                video(i).rate = rate;
                video(i).nrFramesTotal = nrFramesTotal;
                video(i).totalDuration = totalDuration;
                video(i).frames = struct('cdata',cell(1,nrFramesCaptured),'colormap',cell(1,nrFramesCaptured));
                video(i).times = zeros(size(video(i).frames));
                video(i).skippedFrames = [];

                if (nrFramesTotal > 0 && any(frames > nrFramesTotal))
                    warning('mmread:general',['Frame(s) ' num2str(frames(frames>nrFramesTotal)) ' exceed the number of frames in the movie.']);
                end

                scanline = ceil(width*3/4)*4; % the scanline size must be a multiple of 4.

                for f=1:nrFramesCaptured
                    [data, time] = FFGrab('getVideoFrame',i-1,f-1);

                    if any(size(data) == 0)
                        warning('mmread:getVideoFrame',['Frame ' num2str(f) ' could not be decoded']);
                    else
                        % the data ordering is wrong for matlab images, so permute it
                        data = permute(reshape(data, 3, width, height),[3 2 1]);
                        video(i).frames(f).cdata = data;
                        video(i).times(f) = time;
                    end
                end

                framerate = (max(video(i).times)-min(video(i).times))/nrFramesCaptured;
                if framerate > 0
                    video(i).skippedFrames = any(diff(video(i).times)>framerate*1.8) & abs(mean(diff(video(i).times))-framerate)/framerate<0.05;
                end

                % if frames are specified then make sure that the order is the same
                if (~isempty(frames) && nrFramesCaptured > 0)
                    [uniqueFrames, dummy, frameOrder] = unique(frames);
                    if (length(uniqueFrames) > nrFramesCaptured)
                        warning('mmread:general','Not all frames specified were captured.  Returning what was captured, but order may be different than specified.');
                        remainingFrames = frames(frames<=uniqueFrames(nrFramesCaptured));
                        [dummy, dummy, frameOrder] = unique(remainingFrames);
                    end

                    video(i).frames = video(i).frames(frameOrder);
                    video(i).times = video(i).times(frameOrder);
                end
            end
        end

        % loop through getting all of the audio data from each stream
        for i=1:nrAudioStreams
            [nrChannels, rate, bits, nrFramesCaptured, nrFramesTotal, subtype, totalDuration] = FFGrab('getAudioInfo',i-1);
            audio(i).nrChannels = nrChannels;
            audio(i).rate = rate;
            audio(i).bits = bits;
            audio(i).nrFramesTotal = nrFramesTotal;
            audio(i).totalDuration = totalDuration;
            audio(i).frames = cell(1,nrFramesCaptured);
            for f=1:nrFramesCaptured
                [data, time] = FFGrab('getAudioFrame',i-1,f-1);
                audio(i).frames{f} = data;
                audio(i).times(f) = time;
            end
            % combine the data across frames
            d = double(cat(1,audio(i).frames{:}));

            % rescale the data so that it is between -1.0 and 1.0
            if (subtype==0)
                %PCM formated data...
                switch (bits)
                    case {4, 8}
                        d = (d-2^(bits-1))/2^(bits-1);
                    case {16, 24, 32}
                        d = d/2^(bits-1);
                end
            elseif (subtype==1)
                if (bits == 32)
                    %IEEE FLOAT formated data...
                    if (max(d) > 1 | min(d) < -1)
                        % there are two float formats one that is already -1 to 1
                        % and the there is between -2^15 to 2^15
                        d = d / 2^15;
                    end
                else
                    warning('Audio data format not recognized/supported, it probably is going to be useless.');
                end
            else

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产综合久久久久久| 国产精品久久久一区麻豆最新章节| 欧美国产视频在线| 麻豆成人综合网| 欧美三级蜜桃2在线观看| 亚洲一级电影视频| 亚洲四区在线观看| 午夜精品免费在线观看| 99精品视频中文字幕| 亚洲国产精品ⅴa在线观看| 国产精品一区专区| 国产日韩欧美精品在线| 国产精品一区一区三区| 国产日韩精品一区二区三区在线| 国产成人鲁色资源国产91色综| 日韩欧美国产综合一区 | 奇米精品一区二区三区在线观看一| 在线观看免费亚洲| 日韩av中文字幕一区二区三区| 91精品久久久久久久91蜜桃 | 久久九九久精品国产免费直播| 国产成人免费av在线| **欧美大码日韩| 欧美三级韩国三级日本一级| 麻豆精品一区二区av白丝在线| 久久精品在线观看| 在线欧美一区二区| 极品少妇xxxx偷拍精品少妇| 日韩理论片在线| 精品卡一卡二卡三卡四在线| 国产成人午夜精品5599| 午夜影视日本亚洲欧洲精品| 久久久一区二区| 日韩一区二区三区免费看 | 成人在线视频首页| 五月天激情综合网| 中文字幕五月欧美| 久久久久久久久久久黄色| 91久久免费观看| 国产sm精品调教视频网站| 日韩综合一区二区| 亚洲五月六月丁香激情| 国产精品久久毛片av大全日韩| 日韩美女在线视频| 91久久免费观看| 97久久久精品综合88久久| 国产一区二区在线视频| 美腿丝袜在线亚洲一区| 亚洲成人一二三| 午夜精品福利在线| 亚洲成人av电影在线| 夜夜嗨av一区二区三区网页| |精品福利一区二区三区| 欧美经典三级视频一区二区三区| 国产网站一区二区三区| 久久久久久99久久久精品网站| 精品福利在线导航| 久久色.com| 亚洲欧洲成人av每日更新| 亚洲免费观看视频| 青草av.久久免费一区| 日韩精品专区在线| 在线观看国产91| 欧美精品18+| 久久在线观看免费| 国产精品国产三级国产三级人妇| 欧美国产一区二区在线观看| 自拍偷拍欧美激情| 亚洲va天堂va国产va久| 美女视频黄久久| 风间由美一区二区三区在线观看| 色综合中文字幕| 欧美一二三区在线| 亚洲人精品午夜| 免费成人性网站| www.亚洲色图.com| 日韩无一区二区| 亚洲欧美日韩小说| 激情文学综合插| 在线观看91精品国产入口| 欧美精品一区二区在线播放| 亚洲免费在线播放| 精品一区二区国语对白| 欧美性一级生活| 国产精品久久久一区麻豆最新章节| 日韩高清在线观看| 欧美在线观看禁18| 国产精品久久久久毛片软件| 精品一区二区三区免费播放| 91久久国产最好的精华液| 久久久夜色精品亚洲| 天天综合色天天综合| 99久久免费国产| 国产欧美一二三区| 久久狠狠亚洲综合| 日韩欧美高清dvd碟片| 性做久久久久久久免费看| 91视频在线看| 国产精品高潮呻吟| 色综合久久综合网欧美综合网| 久久久91精品国产一区二区三区| 麻豆国产精品一区二区三区 | 日产欧产美韩系列久久99| 欧美私模裸体表演在线观看| 一个色综合网站| 欧洲精品一区二区三区在线观看| 国产精品天美传媒| 99国产精品视频免费观看| 亚洲免费观看高清| 欧美图区在线视频| 男人操女人的视频在线观看欧美| 欧美日韩一区二区三区在线看| 日韩专区在线视频| 久久女同精品一区二区| 不卡的av电影| 丝袜诱惑亚洲看片| 精品免费国产二区三区 | 99视频精品在线| 亚洲欧美偷拍另类a∨色屁股| 欧美性色黄大片| 国产综合色精品一区二区三区| 国产精品理论在线观看| 在线观看视频一区二区| 麻豆国产精品官网| 欧美激情综合五月色丁香小说| 色久优优欧美色久优优| 蜜桃视频在线观看一区| 亚洲色图欧洲色图婷婷| 91麻豆精品国产无毒不卡在线观看| 亚洲伊人色欲综合网| 久久99九九99精品| 欧美色区777第一页| 国产精品正在播放| 亚洲女同ⅹxx女同tv| 久久精品日产第一区二区三区高清版| 成人一区二区三区| 麻豆精品一区二区综合av| 一区二区在线观看免费视频播放| 欧美一区二区三区免费大片 | 韩国成人精品a∨在线观看| 一区二区三区精品| 国产精品久久99| 久久色成人在线| 日韩一区二区三| 欧美精品aⅴ在线视频| 欧美日韩精品一区二区天天拍小说| 不卡一区二区三区四区| 久久99国产精品免费网站| 毛片av一区二区| 美女一区二区久久| 蜜桃av一区二区三区电影| 亚洲一卡二卡三卡四卡五卡| 亚洲欧洲日韩av| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 久久久亚洲午夜电影| 久久精品欧美一区二区三区不卡 | 精品国产自在久精品国产| 制服视频三区第一页精品| 宅男在线国产精品| 欧美一区二区三区性视频| 精品国产精品网麻豆系列| 精品乱码亚洲一区二区不卡| 国产午夜精品久久久久久免费视| 久久久久久**毛片大全| 成人欧美一区二区三区| 亚洲乱码国产乱码精品精的特点 | 亚洲国产一区二区视频| 亚洲福利一区二区| 国产一区二区视频在线播放| 国产综合久久久久影院| 91丨九色丨黑人外教| 欧美高清性hdvideosex| 麻豆成人在线观看| 色狠狠色狠狠综合| 日韩精品中文字幕在线不卡尤物| 久久只精品国产| 亚洲免费观看高清完整版在线观看熊| 国模无码大尺度一区二区三区| 成人午夜免费电影| 国产精品乱码人人做人人爱 | 婷婷丁香激情综合| 欧美伦理影视网| 精品亚洲aⅴ乱码一区二区三区| 在线综合视频播放| 国产一区免费电影| 国产欧美日产一区| 一本色道久久综合亚洲91 | 色婷婷综合在线| 亚洲国产综合91精品麻豆| 欧美一区二区国产| 成人午夜电影网站| 亚洲黄色免费电影| 精品欧美一区二区三区精品久久 | 国产精品初高中害羞小美女文| 亚洲国产欧美一区二区三区丁香婷| 北岛玲一区二区三区四区 | 国产精品久久久久久久久久久免费看 | 国产精品美女久久久久久久久 | 麻豆一区二区三区| 国产欧美综合在线观看第十页|