How to specify stride through input video file?

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
gcecil
Posts: 1
Joined: 2014-04-07T05:03:07-07:00
Authentication code: 6789

How to specify stride through input video file?

Post by gcecil »

My YUV encoded progressive video file convert s successfully into a series of bmp format frames. For processing I want to extract every 30th frame from the input video. Is there a way to specify this stride in a convert command line argument so that I don't have the overhead of generating all converted frames then deleting all but every 30th? Thank you
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to specify stride through input video file?

Post by fmw42 »

In IM you can put a comma separate list of the frame you want using [0,29,etc] with the filename when reading the image. But there is no built in skip. Since doing the comma list would be rather long and tedious for lots of frames, the best thing would be to write a script loop to collect all the frames you want. The loop can use whatever skip factor you want.

Please identify your version of IM and what platform, since the scripting will be different for unix and windows.

see
http://www.imagemagick.org/Usage/basics/#list_ops
http://www.imagemagick.org/script/comma ... essing.php (selecting frames)
Post Reply