Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'd like to convert a movie into jpeg in a specific way. I was wondering if ffmpeg can help here.

What I need to achieve is every 25 frames from the movie needs to be written in a single .jpeg file - one under another. So that from a single movie I get

part1.jpg
  frame1
  frame2
  frame3
  ...
  frame25

part2.jpg
  frame26
  frame27
  frame28
  ...
  frame50

...

Can this be done without dumping the file into separate .jpegs and then modifying them?

share|improve this question
    
Do you mean that you want a jpeg of every 25th frame (i.e., ignoring every other frame), starting at frame 1? Or are you looking for some kind of composition of 25 frames into one image? –  sblair Feb 6 '10 at 4:54
    
A composition of every 25 frames into one partXXX.jpeg - frames saved one vertical stripe. –  viraptor Feb 6 '10 at 11:32

2 Answers 2

up vote 2 down vote accepted

I'm far from an ffmpeg expert, but I don't believe ffmpeg is capable of this level of image processing by itself. I think, in order to achieve your desired goal, you'll need this workflow:

  1. Extract all frames to individual, temporary image files with ffmpeg;
  2. Combine a sequence of 25 temporary image files into a single final image with a JPEG tool (such as montage from the ImageMagick package);
  3. Repeat step 2 until all final images have been created.

This should be fairly easy to script, but it will take up a lot of disk space while it's working.

share|improve this answer
    
Exactly - I wanted to save on the disk space by not creating every frame separately... –  viraptor Feb 6 '10 at 14:56
    
some other tool might be able to do that, but i don't think ffmpeg is capable, sorry. (i could also be wrong.) –  quack quixote Feb 6 '10 at 18:07

With a recent ffmpeg, you can simply use the tile filter like so:

ffmpeg -i input.mp4 -filter:v 'tile=layout=1x25' out%03d.jpg

This will produce files labelled out001.jpg, out002.jpg, and so on; and each image will be exactly as described in the question.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.