开发者

How to import .AVI files?

开发者 https://www.devze.com 2023-02-24 22:14 出处:网络
I am trying to import an .avi file for frame processing. Import[\"c:\\\\windows\\\\clock.avi\",\"Elements\"]

I am trying to import an .avi file for frame processing.

Import["c:\\windows\\clock.avi","Elements"]
Import["c:\\windows\\clock.avi","VideoEncoding"]
Import["c:\\windows\\clock.avi"]
Import["c:\\windows\\clock.avi",{"Frames",{5,6}}]

Out[115]= {Animation,BitDepth,ColorSpace,Data,Duration,FrameCount,FrameRate,
           Frames,GraphicsList,ImageList,ImageSize,VideoEncoding}
Out[116]= rle8
Out[117]= {1,2,3,4,5,6,7,8,9,10,11,12}
During evaluation of In[115]:= Import::fmterr: Cannot import data as video format.
During evaluation of In[115]:= Import::fmterr: Cannot import data as video format.
Out[118]= {$Failed,$Failed}  
开发者_如何学C

It reports the same error with all avi files I tested.

Any hints?


AVI is a container format. You can encode movies with totally bizar and rare formats and still call it .avi.

You could use a video format converter like freemake to convert your movie into a format Mathematica can use. Check with Internal`$VideoEncodings what kind of internal formats are recognized.

Quite often, Quicktime (.mov) works easiest. AVIs sometimes load just fine, but don't display at all even if I have the correct codec on board and all my players can play it.

If all else fails, you can try VirtualDub. It can read AVIs and split them into separate images, which can easily be imported into mma.

EDIT
I recall from my most recent video project a total failure to read the AVIs I got from having the FireFox plugin DownloadHelper download a certain YouTube movie (though it played in all the players I have, VLC, Media Player Classic, Windows Media player etc.). A conversion by DH to .mov worked but DH inserts its logo into it. So finally I resorted to a download with FreeMake and conversion to individual frames by means of VirtualDub.

0

精彩评论

暂无评论...
验证码 换一张
取 消