www.photomacrography.net :: View topic - Stacking frames extracted from movie - which software
www.photomacrography.net Forum Index
An online community dedicated to the practices of photomacrography, close-up and macro photography, and photomicrography.
Photomacrography Front Page Amateurmicrography Front Page
Old Forums/Galleries
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Stacking frames extracted from movie - which software
Goto page Previous  1, 2
 
Post new topic   Reply to topic    www.photomacrography.net Forum Index -> Macro and Micro Technique and Technical Discussions
View previous topic :: View next topic  
Author Message
zzffnn



Joined: 22 May 2014
Posts: 1455
Location: Texas USA

PostPosted: Sun Feb 26, 2017 7:01 pm    Post subject: Reply with quote

Thank you very much, jnh!

So I did not do it incorrectly, the FIJI software is just not efficient/too slow on my computer. Last night I had to terminate the software as it took forever to run a fast edf stack (and it never seemed to finish, for the 10 min I waited).

Zerene or Helicon is much faster in comparison. I will go with Zerene, I guess, since it is fast and produces very good stacks.
_________________
Selling my inverted phase contrast 20x objective for petri dish peeking
Back to top
View user's profile Send private message Visit poster's website
rjlittlefield
Site Admin


Joined: 01 Aug 2006
Posts: 18179
Location: Richland, Washington State, USA

PostPosted: Sun Feb 26, 2017 7:51 pm    Post subject: Reply with quote

Getting back to the original question of how to extract frames from video, FFmpeg (https://ffmpeg.org/) is good for for that.

Examples...

I have at hand a 5 minutes, 0 seconds video file shot by Canon T1i as 1920x1080, 20 fps.

The following command:

Code:
ffmpeg -i MVI_0110.MOV -an -sn -y -q:v 1 VideoFrames\Frame%5d.jpg

extracted all frames as 6002 .jpg files (300 seconds * 20 frames per second), in about 34 seconds of wall clock time. (This is on a hefty gaming-class machine.)

To extract only a subset of 110 frames beginning at 1:19 and going for 5.5 seconds, use:

Code:
ffmpeg -ss 1:19 -i MVI_0110.MOV -an -sn -y -q:v 1 -t 5.5 VideoFrames\Frame%5d.jpg

The arguments are:

-ss 1:19 = seek to 1:19 on input
-an = "disable audio recording", probably not really required here
-sn = "disable subtitle recording", likewise
-y = "overwrite output files without asking", handy for testing
-q:v 1 = specify output quality, gives bigger JPEG files than default or -q:v 0
-t 5.5 = limit output to 5.5 seconds

Note that the -ss and -t options allow fractional seconds to be specified, but the notation is liable to be different from video editors that use seconds.frames notation. At 20 fps, 5.5 seconds and 5.10 seconds.frames mean the same thing.

I hope this helps!

--Rik
Back to top
View user's profile Send private message Visit poster's website
zzffnn



Joined: 22 May 2014
Posts: 1455
Location: Texas USA

PostPosted: Sun Feb 26, 2017 9:17 pm    Post subject: Reply with quote

Thank you very much, Rik. That was very helpful!

I will have to give ffmpeg a try then, even though I try to avoid command lines in general.
_________________
Selling my inverted phase contrast 20x objective for petri dish peeking
Back to top
View user's profile Send private message Visit poster's website
zzffnn



Joined: 22 May 2014
Posts: 1455
Location: Texas USA

PostPosted: Tue Feb 28, 2017 11:41 am    Post subject: Reply with quote

ffmpeg worked for me, thank you very much, Rik!

For stacking, does BMP provide any advantage over JPG? What is the best photo format I should use, if that matters?

I like ffmpeg extracted frames better than those extracted by CombineZP.

Somehow CombineZP made extracted frames (2047x1151p) larger than original (1920x1080p). And it made some artifacts at frame edges that were not in the movie nor in ffmpeg frames. Also it is slower than ffmpeg. Maybe I did something wrong. I could not tell how CombineZP extracts movie frame, as it was downloaded as a single app, not a few folders like ffmpeg or FIJI.

1st movie frame from ffmpeg. I got about 1920x1080p each frame, ~130KB as JPG, or ~5.93MB each BMP. My camera, micro 3/4 Olympus E-PM2, captures movies at a fix rate of 30 frames per second and as 1920x1080p mov.


1st movie frame from CombineZP (note artifacts at frame edges that were not in the movie nor in ffmpeg frames). I got about 2047x1151p each frame, ~1.00MB each jpg, or ~8.98MB each BMP



For other computer dummies, here is how I installed ffmpeg:
http://www.wikihow.com/Install-FFmpeg-on-Windows

I had to create a "PATH" there as new "user variable" and enter "%USERPROFILE%\AppData\Local\Temp;c:\ffmpeg\bin" as "Variable value".

The "Start" - "run" - "cmd" - Enter the command “ffmpeg –version”
Then use Rik's command lines exactly as they are. Take note to spell out the full drive/folder/file path for movie and photo files.
_________________
Selling my inverted phase contrast 20x objective for petri dish peeking
Back to top
View user's profile Send private message Visit poster's website
rjlittlefield
Site Admin


Joined: 01 Aug 2006
Posts: 18179
Location: Richland, Washington State, USA

PostPosted: Tue Feb 28, 2017 12:50 pm    Post subject: Reply with quote

Excellent -- I'm glad to hear that all is working well now.

zzffnn wrote:
For stacking, does BMP provide any advantage over JPG? What is the best photo format I should use, if that matters?

Realistically, I doubt that it matters. BMP is similar to uncompressed TIFF, so your 5.93 MB is just 1920x1080x3 bytes, divided by 1024^2 bytes per megabyte. The JPG's are of course compressed, and typical microscope images have so much fuzzy stuff that they compress very well. In the nematode images that I have just now compared, I can't see any visual differences between JPG and BMP, both produced by ffmpeg.

Quote:
I could not tell how CombineZP extracts movie frame, as it was downloaded as a single app, not a few folders like ffmpeg or FIJI.

I think it links to whatever codec libraries it finds installed in Windows. The mirroring artifacts around the outside are something that CombineZP always adds, regardless of source format.

--Rik
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.photomacrography.net Forum Index -> Macro and Micro Technique and Technical Discussions All times are GMT - 7 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group