Login  Register

Re: importing video on PC

Posted by ctrueden on Jun 02, 2011; 5:21pm
URL: http://imagej.273.s1.nabble.com/importing-video-on-PC-tp3684391p3684392.html

Hi Russell,

Cute trick, and nice guide! Have you considered adding these directions to
the ImageJ Documentation Wiki? You could make a How-To:

  http://imagejdocu.tudor.lu/doku.php?id=howto:start

Regards,
Curtis

On Thu, Jun 2, 2011 at 12:35 AM, Russell Wyeth <[hidden email]> wrote:

> Hi,
>
> I thought I'd share a recent workaround I discovered for importing video
> into ImageJ in Windows.  I've been bothered for some time by the time and
> disk space wasted by ImageJ's inability to import anything but uncompressed
> AVI videos. Although the Quicktime Opener can import some videos on PC, at
> least some modern codecs such as DivX and Xvid cannot be read. For these, I
> have found a workaround using AviSynth and a couple other free utilities.
> Although the setup takes some effort, it seems to work easily thereafter.
>  Instructions I composed for my students are pasted in below.
>
> Cheers,
> Russell
>
>
>
> Importing AVI Videos
>
> On PC (for all installed windows codecs)
>
>   1. Install all of the following
>         1. AviSynth
>            http://avisynth.org/mediawiki/Main_Page
>         2. Pismo File Mount
>            http://www.pismotechnic.com/download/
>         3. AVFS
>            http://www.turtlewar.org/avfs/
>   2. Use notepad to create an avisynth script for the video you want to
> load
>         1. Script contents:
>            AVISource("videofilename.avi")
>            ConvertToRGB24()
>         2. Save as videofilename.avs (THAT 'S' IN *.AVS IS IMPORTANT)
>   3. Mount the videofilename.avs file
>         1. Right click in explorer and choose "Quick mount"
>            This creates a mounted (fake) folder, inside of which will be a
> new version of the video named videofilename.avi (i.e., the same as the
> original)
>         2. NB: If you decide you want to delete the videofilename.avs file
> and corresponding folder, you must first right click and 'Unmount' the avs
> file.
>   4. In ImageJ, click File>Import>AVI, and then just select the newly
> created videofilename.avi inside the mounted folder.
>      You can now import the AVI provided AviSynth can read the file, which
> will include any AVI file for which the codecs are installed in Windows.
>
>
>   5. Batch files to speed the process up (just double click the batch files
> to perform their actions)
>         1. To create and mount avs files for all videos in a folder, open
> notepad, save the file as "multiavscreatemount.bat", paste the following
> code in, and save again
>
>            for %%a IN (dir /b *.avi) do call :avscreate %%a
>            GOTO :DONE
>
>            :avscreate
>            if (%1)==(dir) GOTO eof
>            echo AVISource("%1")> %1.avs
>            echo ConvertToRGB24()>> %1.avs
>            pfm mount %1.avs
>            GOTO :eof
>
>            :DONE
>
>         2. To unmount and delete avs files for all videos in a folder, open
> notepad, save the file as "multiunmountdel.bat", paste the following code
> in, and save again
>
>            for %%a IN (dir /b *.avs) do call :unmount %%a
>            GOTO :DONE
>
>            :unmount
>            if (%1)==(dir) GOTO eof
>            pfm unmount %1
>            del %1
>            GOTO :eof
>
>            :DONE
>
>
>
> --
>
> Russell Wyeth
> Biology, St Francis Xavier University
> P.O. Box 5000 Antigonish, NS B2G 2W5 Canada
> Shipping: 1 West St. Antigonish, NS B2G 2W5 Canada
> http://people.stfx.ca/rwyeth/
> Ph: 9028673886 Fx: 9028672389
> Cell: 9023180250
>