Discussion:
IM as movie-to-image-converter?
Günter Bachelier
2011-11-11 21:12:43 UTC
Permalink
Hello,

is it possible to convert (all) the frames of a movie file to images?

Thanks,

Guenter
Anthony Thyssen
2011-11-14 07:15:37 UTC
Permalink
On Fri, 11 Nov 2011 22:12:43 +0100
Günter Bachelier <***@VI-ANEC.de> wrote:
| Hello,
|
| is it possible to convert (all) the frames of a movie file to images?
|

Yes though it is not straight forward with IM, as movies have a LOT of
frames, which will generally overflow memory,


For this a better idea is to use a more specialised video program
such as ffmpeg or mencoder, snap shot them while playing movies
using hot keys in xine, or vlc. These can also move frame by frame to
get exactly the right moment.

For example...
mplayer file.mov -vf scale=320x240 -ss 01:30 -ao null \
-vo png:z=3 -frames 5


Another method is to deal with the video as a image stream.

For example I wrote a script to extract one image at a time from a stream
of PPM images (generated by ffmpeg) and run each frame through a convert
command with the user provided arguments.

the script is called... "process_ppm_pipeline"
http://www.imagemagick.org/Usage/scripts/process_ppm_pipeline

here is and example use...
ffmpeg extracts a stream of PPM images,
process them to flip the video up-side-down
and then join them back together to form a new video.


ffmpeg input.mpg -f image2pipe -vcodec ppm | pnmnoraw |
process_ppm_pipeline -flip |
ffmpeg -f image2pipe -vcodec jpeg output.mpg

Note this was a proof of concept, and I an looking to get IM handling
image streams like this better.


See the old Discussion on IM Discussion forum...
http://www.imagemagick.org/discourse-server/viewtopic.php?f=2&t=18320&p=71150


Anthony Thyssen ( System Programmer ) <***@griffith.edu.au>
--------------------------------------------------------------------------
Exile by starship...
"No one's ever come back... Hell, no one's even arrived yet!"
-- Orson Scott Card, "Capitol"
--------------------------------------------------------------------------
Anthony's Castle http://www.ict.griffith.edu.au/anthony/

Continue reading on narkive:
Loading...