Subject: [EXTERNAL] Extracting frames from movies in Igor
In-Reply-To: <FB0A2E2E-887E-499F-83F6-34DE4785EFD3@uah.edu>
References: <672415D8-1897-472C-808A-1EC33948B4EC@nasa.gov>
<822E42AD-5472-4BB8-9DC5-DE4F51702956@uah.edu>
<FE90E523-7CFD-4887-AAF0-8E6FD665ABC0@nasa.gov>
<8AB538AA-000C-411E-8AA6-EE4C82080C81@uah.edu>
<2D54481D-6BD2-4787-AD31-26E2DBB9F469@lfor.de>
<03613EE5-3EE2-4B41-AA10-F4F2E6424880@uah.edu>
<ED81FBF3-A50E-414D-95BE-0863074F2D88@lfor.de>
<FB0A2E2E-887E-499F-83F6-34DE4785EFD3@uah.edu>
Message-ID: <d3ac77b4-5ca0-7cf6-f9e7-487734e3bef5@colostate.edu>
I've also looked into the original task described in this thread for other projects and have been following this thread with great interest.
Personally and currently I favor the use of ImageJ to "pre-process" the movie file into an Igor-friendly format over the use of FFmpeg executed from Igor.
I am a long-time user of FFmpeg and appreciate its utility as part of the solution for this particular task. Additionally, I am predisposed to the style that accesses the external engine (FFmpeg) from within Igor. My favorite solutions involve Igor being "in control" of the processing.
The reason I favor the ImageJ solution (just saying not forcing anyone to agree with me) is that FFmpeg has gone over to the Homebrew installation process and I am not very happy with the Homebrew process because (at least the last time I studied and tested it) it "steps" all over the standard unix directory tree as part of its installation process. I judge this to not be a robust and lightweight strategy for my directories. Leave as much of my directory tree alone, thank you.
If Homebrew has changed this behavior since my last encounter with it I sincerely welcome being educated on it.
You may judge differently.
Thanks to the contributors of this thread - it refers to an important and highly useful area of data processing and we all profit from your labors. :)
Best regards,
Joseph
On Fri, 06 Dec 2019 8:00 AM, Jeffrey Weimer (UAH) wrote:
> Wonderful!
>
> The link also eventually led me to ffprobe, a great command line resource to find information about the video files themselves.
>
> After digesting this with some testing on the files I have, I suspect that the process to code a video translation avi -> Igor Pro on macOS is a bit more than I can immediately tackle. The FFmpeg command line is definitely the option to use for this, going through an ExecuteScript call from Igor Pro.
>
> So, going back to the original question, I?d suggest using ImageJ to do the conversion avi -> TIFF stacks first. Then continue after that with Igor Pro using the ImageLoad operation (which itself is so much easier to handle than PlayMovie or PlayMovieAction). This is likely the path that I will standardize on for our group, primarily since those who need to analyze avi videos are not command-line-conversant in either macOS or Windows (and what we are doing needs to work using Igor Pro on either macOS or Windows).
>
> Thanks for the insights!!
>
> --
> Jeffrey J Weimer, Associate Professor
> Chemistry / Chemical & Materials Engineering, UAH
> Huntsville, AL 35899 phone: 256-824-6954
>
>> On Dec 5, 2019, at 8:34 PM, Johannes Steinmann <igor-list at lfor.de> wrote:
>>
>> Does this help?
>> <https://www.bugcodemaster.com/article/extract-images-frame-frame-video-file-using-ffmpeg>
>>
>> Best,
>> Johannes
>>
>>> On Dec 5, 2019, at 19:45, Jeffrey Weimer (UAH) <weimerj at uah.edu <mailto:weimerj at uah.edu>> wrote:
>>>
>>> I?ve installed FFmpeg using Homebrew. It works.
>>>
>>> All I need is the syntax to extract a specific frame (e.g. 37) or a set of frames (e.g. 2 - 10) or a set of frames in an incremented manner (e.g. 2 - 37 in steps of 4) from an avi video and generate the results as TIFF with no change in RGB or resolution or whatever else.
>>>
>>>> ffmpeg -i input.avi ? output.tiff
>>>
>>> I would build that syntax into the Image Tools using ExecuteScript. This adaptation would make it possible to be able to import movie frames from avi into Igor Pro (as TIFF images). As far as I can tell with FFmpeg, such code should work on both Windows and macOS (with FFmpeg installed).
>>>
>>> Any help with the correct syntax would be appreciated.
>>>
>>> --
>>> Jeffrey J Weimer, Associate Professor
>>> Chemistry / Chemical & Materials Engineering, UAHuntsville
>>> Huntsville, AL 35899 phone: 256-824-6954
>>>
>>>> On Dec 5, 2019, at 4:41 PM, Johannes Steinmann <igor-list at lfor.de <mailto:igor-list at lfor.de>> wrote:
>>>>
>>>> I am successfully using the static builds from <https://evermeet.cx/ffmpeg>
>>>> You can also install ffmpeg via brew if you like.
>>>> Johannes
>
--
Joseph A. DiVerdi, Ph.D., M.B.A.
Associate Professor of Chemistry
Colorado State University, Fort Collins, CO, USA
+1.970.980.5868 - http://sites.chem.colostate.edu/diverdi