<p>It's rather a powershell-specific question than FFmpeg, but here you go:</p>

<pre><code>ffmpeg -i &lt;input&gt; &lt;some_encoding_options&gt; -f mp4 "my_filename_"$(get-date).ToString("yyyy-MM-dd_HH-mm")".mp4"
</code></pre>

<p>Change the parameter of <code>ToString</code> to whatever you want, you can find more info about PS date formatting syntax <strong><a href="https://technet.microsoft.com/en-us/library/ee692801.aspx" rel="nofollow">here</a></strong>.</p>

<p>A little cheatsheet (all of these have leading zeroes):</p>

<ul>
<li><code>yyyy</code> year</li>
<li><code>MM</code> month</li>
<li><code>dd</code> day</li>
<li><code>hh</code> hour in 12-hour format</li>
<li><code>HH</code> hour in 24-hour format</li>
<li><code>mm</code> minute</li>
</ul>

CC BY-SA 3.0
2016-05-24T07:25:00.977Z
2016-05-24T07:35:18.377Z
2016-05-24T07:35:18.377Z
Gergely Lukacsy
<p>You can do it with scripting by renaming the files. I don't have a Windows machine at hand at the moment so I can't test this but this is what I would do in power shell:</p>

<p>First navigate to the directory containing the image sequence,  then</p>

<pre><code>mkdir sorted_images;
$serial=0;
Get-childItems *. jpg | sort-object date | %{
Cp $_ (".\sorted_images\image_{0}.jpg" -f ($serial.toString("00000")));
$serial++}
</code></pre>

<p>That script should copy all the jpg images in the current folder to a new folder and rename them with a five digit serial number. Try it out on some test images first because I haven't tested it myself. </p>

CC BY-SA 3.0
2015-12-26T01:28:17.713Z
2015-12-26T01:28:17.713Z
stib
<p>I am using FFmpeg
I'd like to create an mp4 using an image sequence. </p>

<p>But the images are not named sequentially, like 1, 2, 3, 4... Instead they are named with a time stamp in the form yyyy-mm-dd-mm.</p>

<p>How can I create a script to achieve this? </p>

CC BY-SA 3.0
2015-12-23T04:21:48.333Z
Which operating system?
Gyan
CC BY-SA 3.0
2015-12-23T04:32:47.563Z
The windows~~~~
kksky
CC BY-SA 3.0
2016-05-24T07:29:09.767Z
@Mulvya Since he mentioned PowerShell, I assume that's Win7 or higher.
Gergely Lukacsy
CC BY-SA 3.0
2016-05-24T07:47:04.130Z
I don't see any mention of Powershell or Windows by the OP.
Gyan
<ffmpeg>
How can I create a video from an image sequence that is named with a date in the FFmpeg?
kksky
# How can I create a video from an image sequence that is named with a date in the FFmpeg?

(Asked by: username_0 on 2015-12-23)

I am using FFmpeg
I'd like to create an mp4 using an image sequence.

But the images are not named sequentially, like 1, 2, 3, 4... Instead they are named with a time stamp in the form yyyy-mm-dd-mm.

How can I create a script to achieve this?

**Tags:** ffmpeg

> **Comments:**
> **username_1**: Which operating system?  
> **username_0**: The windows~~~~  
> **username_2**: @Mulvya Since he mentioned PowerShell, I assume that's Win7 or higher.  
> **username_1**: I don't see any mention of Powershell or Windows by the OP.  

---

## 2 answers

### Answer by username_2 on 2016-05-24. Score: 1

It's rather a powershell-specific question than FFmpeg, but here you go:
ffmpeg -i   -f mp4 "my_filename_"$(get-date).ToString("yyyy-MM-dd_HH-mm")".mp4"

Change the parameter of ToString to whatever you want, you can find more info about PS date formatting syntax here.
A little cheatsheet (all of these have leading zeroes):

yyyy year
MM month
dd day
hh hour in 12-hour format
HH hour in 24-hour format
mm minute


---

### Answer by username_3 on 2015-12-26. Score: 1

You can do it with scripting by renaming the files. I don't have a Windows machine at hand at the moment so I can't test this but this is what I would do in power shell:
First navigate to the directory containing the image sequence,  then
mkdir sorted_images;
$serial=0;
Get-childItems *. jpg | sort-object date | %{
Cp $_ (".\sorted_images\image_{0}.jpg" -f ($serial.toString("00000")));
$serial++}

That script should copy all the jpg images in the current folder to a new folder and rename them with a five digit serial number. Try it out on some test images first because I haven't tested it myself.


---

