Answers.Body: <p>You're better off using the <code>tile</code> filter for this:</p>
  
  <pre><code>ffmpeg -i INPUT.mov -vf fps=1,scale=192:108,tile=54x1 output.jpg
  </code></pre>
  
  <p>The tile argument is the size of a rectangle. So for a 54 second video, <code>54x1</code> produces a horizontal stack of 54 frames. Use <code>1x54</code> for a vertical stack.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-15T12:34:49.410Z
Answers.Text: Thanks a lot. Works like a charm. 
  Is it possible to specify what frame number each second it should choose? Now for a 25fps clip it seems to choose frame 13. I would like it to choose the first frame each second.
Answers.UserDisplayName: Thomas
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-15T13:07:37.357Z
Answers.Text: Replace `fps=1` with `select='not(mod(n,25))'`
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-15T14:13:31.293Z
Answers.Text: Once again, many thanks! 
  I needed to add it whithin "" in this filter chain. Now it works.
  
  `-vf "select='not(mod(n,25))'",scale=960:540,colormatrix=bt709:bt601,tile=30x1`
Answers.UserDisplayName: Thomas
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-14T17:06:02.403Z
Answers.LastActivityDate: 2016-11-14T17:06:02.403Z
Answers.UserDisplayName: Gyan
Body: <p>Is it possible to input a video and extract images every second while simultaneously stack them horizontally or vertically with the <strong>"hstack"</strong> filter to create one jpg image?</p>
  
  <p>The only way I can figure out how to do it is by extractning the still-frames with this command:</p>
  
  <pre><code>ffmpeg -i INPUT.mov -vf fps=1 -s 192x108 thumbnails%03d.jpg
  </code></pre>
  
  <p>And then inputting them one by one and then specifying then number of inputs like this.</p>
  
  <pre><code>ffmpeg -y -i thumbnails001.jpg -i thumbnails002.jpg -i thumbnails003.jpg... filter_complex vstack=inputs=3 output.jpg
  </code></pre>
  
  <p>It would be nice if it was possible to do in one more dynamic chunk from the original video or at least from one inputted Video-Sequence and not manually inserting the number of INPUTS needed to create the Stack. </p>
  
Tags: <video><ffmpeg><filter>
Title: Stack images with "hstack"-filter from video or image sequence in ffmpeg
UserDisplayName: Thomas
ThreadText: # Stack images with "hstack"-filter from video or image sequence in ffmpeg
  
  (Asked by: username_0 on 2016-11-14)
  
  Is it possible to input a video and extract images every second while simultaneously stack them horizontally or vertically with the **"hstack"** filter to create one jpg image?
  
  The only way I can figure out how to do it is by extractning the still-frames with this command:
  
  ```
  ffmpeg -i INPUT.mov -vf fps=1 -s 192x108 thumbnails%03d.jpg
  
  ```
  
  And then inputting them one by one and then specifying then number of inputs like this.
  
  ```
  ffmpeg -y -i thumbnails001.jpg -i thumbnails002.jpg -i thumbnails003.jpg... filter_complex vstack=inputs=3 output.jpg
  
  ```
  
  It would be nice if it was possible to do in one more dynamic chunk from the original video or at least from one inputted Video-Sequence and not manually inserting the number of INPUTS needed to create the Stack.
  
  **Tags:** video, ffmpeg, filter
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-11-14. Score: 2 | Accepted answer
  
  You're better off using the `tile` filter for this:
  
  ```
  ffmpeg -i INPUT.mov -vf fps=1,scale=192:108,tile=54x1 output.jpg
  
  ```
  
  The tile argument is the size of a rectangle. So for a 54 second video, `54x1` produces a horizontal stack of 54 frames. Use `1x54` for a vertical stack.
  
  > **Comments:**
  > **username_0**: Thanks a lot. Works like a charm.  Is it possible to specify what frame number each second it should choose? Now for a 25fps clip it seems to choose frame 13. I would like it to choose the first frame each second.  
  > **username_1**: Replace `fps=1` with `select='not(mod(n,25))'`  
  > **username_0**: Once again, many thanks!  I needed to add it whithin "" in this filter chain. Now it works.  `-vf "select='not(mod(n,25))'",scale=960:540,colormatrix=bt709:bt601,tile=30x1`  
  
  ---
  
  