Video screen capture using image magick

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
bhushan
Posts: 3
Joined: 2018-08-14T17:28:53-07:00
Authentication code: 1152

Video screen capture using image magick

Post by bhushan »

Hello, I need to take the screen capture from the video. Can I use ImageMagick for that? If yes, how can I use that? The overall idea is to capture at least one screen of the video.

Thanks in advance.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Video screen capture using image magick

Post by snibgo »

You can capture one frame, such as frame 100, of the video like this:

Code: Select all

magick myvid.mp4[100] out.png
snibgo's IM pages: im.snibgo.com
bhushan
Posts: 3
Joined: 2018-08-14T17:28:53-07:00
Authentication code: 1152

Re: Video screen capture using image magick

Post by bhushan »

Thank you, snigbo for the quick response.

Can I also provide arguments to specify height and width of the output image?
bhushan
Posts: 3
Joined: 2018-08-14T17:28:53-07:00
Authentication code: 1152

Re: Video screen capture using image magick

Post by bhushan »

Hi Snigbo,

I was able to find out how to resize but the output picture is blurry. Below is the command which I used.

Code: Select all

magick "SampleVideo_1280x720_5mb.mp4[100]" -resize 250x250 videoout.png
Can you suggest if there is a better way to get more clarity of the screen capture?

Thanks.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Video screen capture using image magick

Post by snibgo »

bhushan wrote:... but the output picture is blurry.
Is the unresized frame blurry? Can you link to it?

Video frames are often blurry, compared to still images. This may be due to movement, or the compromises of in-camera processing needed to record 30 frames/second.

There are many possible ways to sharpen an image. especially when also downsizing it.
snibgo's IM pages: im.snibgo.com
Post Reply