Answers.Body: <p>Besides the workaround in my comment, you should be able to use this syntax from the ffmpeg <a href="http://ffmpeg.org/ffmpeg.html#Video-and-Audio-file-format-conversion">documentation</a>:</p>
  
  <pre><code>ffmpeg -f image2 -pattern_type glob -i '*.png' out.avi
  </code></pre>
  
  <p>The quotes are important, you need ffmpeg to see the <code>*</code>, not have the shell expand it.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-03-05T20:14:52.263Z
Answers.Text: Doesn't work for me, but it's probably because I have an older build.  I'm accepting this one because it's most likely to help future users.
Answers.UserDisplayName: Brigand
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-03-05T22:06:44.067Z
Answers.Text: According to the [ffmpeg documentation](http://ffmpeg.org/ffmpeg.html#Video-and-Audio-file-format-conversion) you should use '*.png' instead of %04d.png with the glob pattern type.
Answers.UserDisplayName: Friend Of George
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-03-06T07:09:49.533Z
Answers.Text: That would then select all the pngs present in the folder, besides 00xx.png, whereas the OP wants to queue only the %04d pngs without worrying about numbering continuity.
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-03-06T20:15:51.380Z
Answers.Text: Did you actually test this command? I don't think `-pattern_type glob` works with `%04d.png` and will probably result in `Could not open file : %04d.png`.
Answers.UserDisplayName: llogan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-03-07T05:26:26.340Z
Answers.Text: I haven't tested it. I just checked the syntax for glob @ http://www.jedit.org/users-guide/globs.html and it seems that %04d won't work. However, %?%?%?%?.png should work.
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-04-05T09:03:42.250Z
Answers.Text: I'm *pretty sure* that you need to put `*.png` in single-quotes (so `'*.png'`) to avoid it being expanded by Unix-style shells (so, OSX and linux etc).
Answers.UserDisplayName: evilsoup
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-15T10:12:57.643Z
Answers.Text: And probably by whatever portability layer ffmpeg on windows is compiled with.  The ffmpeg docs example has it quoted.
Answers.UserDisplayName: Peter Cordes
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-27T13:01:00.910Z
Answers.Text: Sadly the ffmpeg developers make file globbing support an *option*! The standard windows builds don't include it.
Answers.UserDisplayName: Timmmm
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-29T09:28:47.673Z
Answers.Text: This isn't working, error: Pattern type 'glob' was selected but globbing is not supported by this libavformat build
  C:\Users\francois.kruger\Documents\tf_global_local\dev\tf_ffmpeg\ffmpeg_examples\renders\img.*.exr: Function not implemented
Answers.UserDisplayName: Frank
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-29T11:54:35.770Z
Answers.Text: Globbing is not supported on Windows.
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-03-05T14:15:40.223Z
Answers.LastActivityDate: 2015-01-16T09:32:29.713Z
Answers.LastEditDate: 2015-01-16T09:32:29.713Z
Answers.UserDisplayName: Gyan
Answers.Body: <p>From <a href="http://www.ffmpeg.org/faq.html">http://www.ffmpeg.org/faq.html</a>:
  If you have large number of pictures to rename, you can use the following command to ease the burden. The command, using the bourne shell syntax, symbolically links all files in the current directory that match *jpg to the ‘/tmp’ directory in the sequence of ‘img001.jpg’, ‘img002.jpg’ and so on.</p>
  
  <p><code>
  x=1; for i in *jpg; do counter=$(printf %03d $x); ln -s "$i" /tmp/img"$counter".jpg; x=$(($x+1)); done
  </code></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-23T06:37:54.577Z
Answers.Text: For me this didn't work until I replaced `for i in *jpg` with `for i in /full/path/*jpg`, because all the symlinks were broken
Answers.UserDisplayName: Jezzamon
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-03-03T03:45:09.887Z
Answers.Text: I used this to combine multiple sequences `seqA-[0001-n].png`, `seqB-[0001-n].png`, etc. Much easier than messing around with image2 globbing and the concat filter.
Answers.UserDisplayName: z0r
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-10-21T08:11:15.173Z
Answers.LastActivityDate: 2013-10-21T08:11:15.173Z
Answers.UserDisplayName: Nikhil
Answers.Body: <p>I would actually suggest the same thing Mulvya suggested.  Whenever I've needed to do stuff like this when dealing with 3D animation renderings, I've renamed the files to make them sequential.  It's just easier to work with that way in a lot of different software unless you need to preserve the file names for some reason.  Total Commander is also a great tool for multi-renaming.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-03-05T20:16:28.720Z
Answers.Text: I ended up doing something similar (a Python renaming script).
Answers.UserDisplayName: Brigand
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-03-04T15:27:51.780Z
Answers.LastActivityDate: 2013-03-04T15:27:51.780Z
Answers.UserDisplayName: AJ Henderson
Answers.Body: <p>For the missing sequence part, I used 2 liner</p>
  
  <pre><code>CONCAT=$(echo $(ls *.png | sort -n -t _ -k 2) | sed -e "s/ /|/g")
  ffmpeg -framerate 25 -i "concat:$CONCAT" -c:v libx264 -profile:v high -pix_fmt yuv420p output.mp4
  </code></pre>
  
  <p>Hope this will help someone in future</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-24T20:03:39.387Z
Answers.LastActivityDate: 2018-09-24T20:03:39.387Z
Answers.UserDisplayName: Shakil Ahmed
Answers.Body: <p>If the images are dated, <code>exiftool</code> can be used to rename the source files to yyyy-mm-dd_hhmm pattern. Then a bash script can create an input file for <code>ffmpeg</code>.</p>
  <p>Here is a script that shows the idea:
  <a href="https://github.com/leobard/timelapse-prepare-and-run-ffmpeg.sh/blob/main/timelapse-prepare-and-run-ffmpeg.sh" rel="nofollow noreferrer">https://github.com/leobard/timelapse-prepare-and-run-ffmpeg.sh/blob/main/timelapse-prepare-and-run-ffmpeg.sh</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-07-18T15:29:45.230Z
Answers.LastActivityDate: 2021-07-18T15:29:45.230Z
Answers.UserDisplayName: leobard
Answers.Body: <p><strong>For recent versions of ffmpeg, see <a href="https://video.stackexchange.com/a/7320/3894">Gyan's answer</a> instead</strong></p>
  <p><em>Original answer:</em></p>
  <hr />
  <p>with ffmpeg 0.11.1 it's as easy as:</p>
  <pre><code>ffmpeg -f image2 -i %*.png out.avi
  </code></pre>
  <p>From the <code>man</code> page, in an example under &quot;Video and Audio file format conversion&quot;:</p>
  <blockquote>
  <p>When importing an image sequence, <code>-i</code> also supports expanding shell-like wildcard patterns (globbing) internally. To lower the chance of interfering with your actual file names and the shell's glob expansion, you are required to activate glob meta characters by prefixing them with a single <code>%</code> character, like in <code>foo-%*.jpeg</code>, <code>foo-%?%?%?.jpeg</code> or <code>foo-00%[234%]%*.jpeg</code>.</p>
  </blockquote>
  <p>Update per comments: on recent versions you should now use <code>-i '*.png'</code> syntax.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-09-12T19:24:32.817Z
Answers.Text: This hasn't been working for me using ffmpeg or avconv in Ubuntu 13.04
Answers.UserDisplayName: hellocatfood
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-27T12:59:52.287Z
Answers.Text: This appears to not be an option any more.
Answers.UserDisplayName: Timmmm
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-27T18:01:50.283Z
Answers.Text: It seems they deprecated this syntax at some point.  The updated documentation was committed 8-Aug-2012 but I can't tell what version that equates to across the multiple branches.  See http://git.videolan.org/?p=ffmpeg.git;a=commit;h=7794ddeae3edba09fbf3e5badfedf5ea20a9a1f6
Answers.UserDisplayName: rymo
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-07T22:03:27.790Z
Answers.Text: The `glob_sequence` pattern type is deprecated, but the `glob` pattern type is not. The answer by Mulvya and Peter Cordes works.
Answers.UserDisplayName: dr. Sybren
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-07T16:17:51.263Z
Answers.Text: `Pattern type 'glob_sequence' is deprecated: use pattern_type 'glob' instead`
Answers.UserDisplayName: Serge Stroobandt
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-18T05:38:18.713Z
Answers.Text: Just as clarification, since this page is currently the top result in Google for that warning message (`Pattern type 'glob_sequence' is deprecated`...): the command given by rymo above (specifically, `-i %*.png`) will _cause_ the warning. To eliminate it, use the slightly-different syntax in Peter Cordes answer (`-i '*.png'`).
Answers.UserDisplayName: James
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-02T18:13:55.277Z
Answers.Text: "Could find no file with path '%*.jpg' and index in the range 0-4" This does not work with ffmpeg 4.1.3
Answers.UserDisplayName: Tomáš Zato
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2013-04-04T16:00:03.457Z
Answers.LastActivityDate: 2021-03-09T15:35:27.607Z
Answers.LastEditDate: 2021-03-09T15:35:27.607Z
Answers.UserDisplayName: rymo
Body: <p>I have a bunch of images, that follow this pattern.</p>
  
  <pre><code>0001.png
  0004.png
  0007.png
  0010.png
  0013.png
  0016.png
  0019.png
  ...
  </code></pre>
  
  <p>They're in the correct order, but FFMPEG ignores anything after the first file, because it can't find a <code>0002.png</code>.  How can I get it to join these files?</p>
  
  <p>I tried</p>
  
  <pre><code>ffmpeg -i %04d.png out.avi
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2013-03-04T15:25:36.740Z
Comments.Text: How about temporarily renaming them, making the AVI and then renaming them back to the (3x-2).png scheme? Bulk Rename Utility @ http://www.bulkrenameutility.co.uk/Main_Intro.php is a free, umm, bulk renamer.
Comments.UserDisplayName: Gyan
Tags: <ffmpeg><linux>
Title: How to get FFMPEG to join non-sequential image files? (skip by 3s)
UserDisplayName: Brigand
ThreadText: # How to get FFMPEG to join non-sequential image files? (skip by 3s)
  
  (Asked by: username_0 on 2013-03-04)
  
  I have a bunch of images, that follow this pattern.
  
  ```
  0001.png
  0004.png
  0007.png
  0010.png
  0013.png
  0016.png
  0019.png
  ...
  
  ```
  
  They're in the correct order, but FFMPEG ignores anything after the first file, because it can't find a `0002.png`. How can I get it to join these files?
  
  I tried
  
  ```
  ffmpeg -i %04d.png out.avi
  
  ```
  
  **Tags:** ffmpeg, linux
  
  > **Comments:**
  > **username_1**: How about temporarily renaming them, making the AVI and then renaming them back to the (3x-2).png scheme? Bulk Rename Utility @ http://www.bulkrenameutility.co.uk/Main_Intro.php is a free, umm, bulk renamer.  
  
  ---
  
  ## 6 answers
  
  ### Answer by username_14 on 2013-04-04. Score: 30 | Accepted answer
  
  **For recent versions of ffmpeg, see [username_1's answer](https://video.stackexchange.com/a/7320/3894) instead**
  
  *Original answer:*
  
  ---
  
  with ffmpeg 0.11.1 it's as easy as:
  
  ```
  ffmpeg -f image2 -i %*.png out.avi
  
  ```
  
  From the `man` page, in an example under "Video and Audio file format conversion":
  
  > When importing an image sequence, `-i` also supports expanding shell-like wildcard patterns (globbing) internally. To lower the chance of interfering with your actual file names and the shell's glob expansion, you are required to activate glob meta characters by prefixing them with a single `%` character, like in `foo-%*.jpeg`, `foo-%?%?%?.jpeg` or `foo-00%[234%]%*.jpeg`.
  
  Update per comments: on recent versions you should now use `-i '*.png'` syntax.
  
  > **Comments:**
  > **username_15**: This hasn't been working for me using ffmpeg or avconv in Ubuntu 13.04  
  > **username_6**: This appears to not be an option any more.  
  > **username_14**: It seems they deprecated this syntax at some point.  The updated documentation was committed 8-Aug-2012 but I can't tell what version that equates to across the multiple branches.  See http://git.videolan.org/?p=ffmpeg.git;a=commit;h=7794ddeae3edba09fbf3e5badfedf5ea20a9a1f6  
  > **username_16**: The `glob_sequence` pattern type is deprecated, but the `glob` pattern type is not. The answer by Mulvya and username_5 username_5 works.  
  > **username_17**: `Pattern type 'glob_sequence' is deprecated: use pattern_type 'glob' instead`  
  > **username_18**: Just as clarification, since this page is currently the top result in Google for that warning message (`Pattern type 'glob_sequence' is deprecated`...): the command given by username_14 above (specifically, `-i %*.png`) will _cause_ the warning. To eliminate it, use the slightly-different syntax in username_5 username_5 answer (`-i '*.png'`).  
  > **username_19**: "Could find no file with path '%*.jpg' and index in the range 0-4" This does not work with ffmpeg 4.1.3  
  
  ---
  
  ### Answer by username_1 on 2013-03-05. Score: 25
  
  Besides the workaround in my comment, you should be able to use this syntax from the ffmpeg [documentation](http://ffmpeg.org/ffmpeg.html#Video-and-Audio-file-format-conversion):
  
  ```
  ffmpeg -f image2 -pattern_type glob -i '*.png' out.avi
  
  ```
  
  The quotes are important, you need ffmpeg to see the `*`, not have the shell expand it.
  
  > **Comments:**
  > **username_0**: Doesn't work for me, but it's probably because I have an older build.  I'm accepting this one because it's most likely to help future users.  
  > **username_2**: According to the [ffmpeg documentation](http://ffmpeg.org/ffmpeg.html#Video-and-Audio-file-format-conversion) you should use '*.png' instead of %04d.png with the glob pattern type.  
  > **username_1**: That would then select all the pngs present in the folder, besides 00xx.png, whereas the OP wants to queue only the %04d pngs without worrying about numbering continuity.  
  > **username_3**: Did you actually test this command? I don't think `-pattern_type glob` works with `%04d.png` and will probably result in `Could not open file : %04d.png`.  
  > **username_1**: I haven't tested it. I just checked the syntax for glob @ http://www.jedit.org/users-guide/globs.html and it seems that %04d won't work. However, %?%?%?%?.png should work.  
  > **username_4**: I'm *pretty sure* that you need to put `*.png` in single-quotes (so `'*.png'`) to avoid it being expanded by Unix-style shells (so, OSX and linux etc).  
  > **username_5**: And probably by whatever portability layer ffmpeg on windows is compiled with.  The ffmpeg docs example has it quoted.  
  > **username_6**: Sadly the ffmpeg developers make file globbing support an *option*! The standard windows builds don't include it.  
  > **username_7**: This isn't working, error: Pattern type 'glob' was selected but globbing is not supported by this libavformat build C:\Users\francois.kruger\Documents\tf_global_local\dev\tf_ffmpeg\ffmpeg_examples\renders\img.*.exr: Function not implemented  
  > **username_1**: Globbing is not supported on Windows.  
  
  ---
  
  ### Answer by username_8 on 2013-10-21. Score: 9
  
  From <http://www.ffmpeg.org/faq.html>:
  If you have large number of pictures to rename, you can use the following command to ease the burden. The command, using the bourne shell syntax, symbolically links all files in the current directory that match \*jpg to the ‘/tmp’ directory in the sequence of ‘img001.jpg’, ‘img002.jpg’ and so on.
  
  `x=1; for i in *jpg; do counter=$(printf %03d $x); ln -s "$i" /tmp/img"$counter".jpg; x=$(($x+1)); done`
  
  > **Comments:**
  > **username_10**: I used this to combine multiple sequences `seqA-[0001-n].png`, `seqB-[0001-n].png`, etc. Much easier than messing around with image2 globbing and the concat filter.  
  > **username_9**: For me this didn't work until I replaced `for i in *jpg` with `for i in /full/path/*jpg`, because all the symlinks were broken  
  
  ---
  
  ### Answer by username_11 on 2013-03-04. Score: 6
  
  I would actually suggest the same thing Mulvya suggested. Whenever I've needed to do stuff like this when dealing with 3D animation renderings, I've renamed the files to make them sequential. It's just easier to work with that way in a lot of different software unless you need to preserve the file names for some reason. Total Commander is also a great tool for multi-renaming.
  
  > **Comments:**
  > **username_0**: I ended up doing something similar (a Python renaming script).  
  
  ---
  
  ### Answer by username_12 on 2018-09-24. Score: 5
  
  For the missing sequence part, I used 2 liner
  
  ```
  CONCAT=$(echo $(ls *.png | sort -n -t _ -k 2) | sed -e "s/ /|/g")
  ffmpeg -framerate 25 -i "concat:$CONCAT" -c:v libx264 -profile:v high -pix_fmt yuv420p output.mp4
  
  ```
  
  Hope this will help someone in future
  
  
  ---
  
  ### Answer by username_13 on 2021-07-18. Score: 0
  
  If the images are dated, `exiftool` can be used to rename the source files to yyyy-mm-dd\_hhmm pattern. Then a bash script can create an input file for `ffmpeg`.
  
  Here is a script that shows the idea:
  <https://github.com/username_13/timelapse-prepare-and-run-ffmpeg.sh/blob/main/timelapse-prepare-and-run-ffmpeg.sh>
  
  
  ---
  
  