X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 19 May 2015 02:15 PM by  Zachary Norman
How can I read .avi video files?
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

Zachary Norman



Basic Member


Posts:173
Basic Member


--
19 May 2015 02:15 PM
    I was wondering if there was a simple method to read avi formatted video files?

    Zachary Norman



    Basic Member


    Posts:173
    Basic Member


    --
    19 May 2015 02:22 PM
    I would check out the documentation regarding the IDLffVideoRead class. Here is a link and an example from the documentation. Note that for an avi formatted file, all that would need to change is the file specified by "file = FILEPATH('CME.mp4', SUBDIRECTORY=['examples','data'])" to include a complete path to your avi movie file such as "file = C:\users\random_user\sample_avi.avi" http://www.exelisvis.com/.../idlffvideoread.html PRO video_read_example2 ;specify the file file = FILEPATH('CME.mp4', SUBDIRECTORY=['examples','data']) ;create the video object oVid = IDLffVideoRead(file) ; Open up an image window, with no data for now img = IMAGE(BYTARR(2,2), /NODATA) ; Get the next packet of data from the file, REPEAT BEGIN data = oVid->GetNext(TYPE=type) ; If we got a frame of video, display it. IF type EQ 1 THEN img.SetData, data ; Keep going until we reach the end of the file. ; Note: End of file is where TYPE=-1. ENDREP UNTIL type EQ -1 ;close the image at the end img.CLOSE END It is important to also note that not ever codec for a video will work properly. If you would like to see the available codec formats for IDLffVideoRead then type the following into the IDL Console. print, IDLffVideoRead.GetCodecs(/video) For a complete list of the formats supported by IDLffVideoRead, type the following line into the IDL Console; print, IDLffVideoRead.GetFormats()
    You are not authorized to post a reply.