How to Sort Hundreds of Photos and Videos by Capture Date for Shotcut Editing
If you've ever come back from a trip with a phone full of photos and a drone full of clips, you know the problem: everything is mixed together, file names don't match the order things happened, and Windows "Date modified" is often wrong. This guide walks through a real example — sorting hundreds of files from a folder called Alicante julio 2026 — into a clean, chronological set ready to drop into Shotcut. You'll see two ways to do it: a safe copy into a new folder, and a rename in place that uses no extra disk space.
Why "Date Modified" Isn't Enough
Windows Explorer's "Date modified" timestamp reflects when the file was last written to disk, not necessarily when the photo or video was actually captured. This becomes a real problem when you're combining footage from different devices — for example, DJI drone videos and smartphone photos — because copying, syncing, or transferring files can change that timestamp. The result is a sort order that looks chronological but isn't. For a trip video where the sequence of events matters, this small discrepancy can throw off the whole story.
The more reliable approach is to read the actual capture date/time embedded in the file's metadata (EXIF data for photos, creation metadata for videos) rather than relying on the file system's modified date.
Which Option Should You Choose?
Both options use the same naming pattern and the same file types. The difference is what happens to your original files and how much disk space you need.
- Option A – Copy to a new
SORTEDfolder: the safest choice, because your originals are never touched. The trade-off is that every photo and video is duplicated, so you need as much free space as the whole folder takes. With large drone and 4K clips, that can be many gigabytes. - Option B – Rename in place: no new folder and no duplicates, so it takes no extra disk space. The trade-off is that the original file names are replaced, so the script saves a log file that lets you trace every old name.
If you have limited disk space or very large video files, Option B is the better fit.
Option A: Copy Into a New SORTED Folder
This PowerShell script copies your files into a new folder, renamed and sorted by timestamp. It never touches your original files — it only creates copies.
Here's what the script does:
- π· Includes JPG, JPEG, PNG, and HEIC photos
- π₯ Includes MP4, MOV, AVI, M4V, MTS, and M2TS videos
- π Sorts everything by timestamp
- π’ Renames copies sequentially, e.g.
0001_20260710_101523.jpg - π Places all copies in a new
SORTEDsubfolder - ✅ Leaves your original files completely untouched
- ⚠️ Uses extra disk space equal to the size of all copied files
Step 1: Open PowerShell
Press the Windows key, type PowerShell, and open Windows PowerShell.
Step 2: Copy and paste this command
Enter your folder address. This is an example: C:\Users\Videos\Alicante julio 2026$src="C:\Users\Videos\Alicante julio 2026"; $dst="$src\SORTED"; New-Item -ItemType Directory -Force -Path $dst | Out-Null; Get-ChildItem $src -File | Where-Object {$_.Extension -match '\.(jpg|jpeg|png|heic|mp4|mov|avi|m4v|mts|m2ts)$'} | Sort-Object LastWriteTime | ForEach-Object -Begin {$i=1} -Process {$ext=$_.Extension.ToLower(); $name="{0:D4}_{1:yyyyMMdd_HHmmss}{2}" -f $i,$_.LastWriteTime,$ext; Copy-Item $_.FullName (Join-Path $dst $name); $i++}
Step 3: Check the result
The script creates a new folder:
C:\Users\Videos\Alicante julio 2026\SORTED
Inside, you'll find your photos and videos copied and renamed in order, like this:
0001_20260710_101523.jpg
0002_20260710_101601.mp4
0003_20260710_101745.jpg
0004_20260710_102012.mp4
Once you've confirmed everything is correct in SORTED folder, then you can use it. At last you can decided to delete either the SORTED folder or your originals to free up the duplicated space — but only after checking the result.
Option B: Rename in Place (No Extra Disk Space)
If you don't want duplicates, rename the files directly in the same folder. Renaming only changes the name written in the file system — the photo or video data is not copied or moved — so it uses no additional space, and each file keeps its original "Date modified" value.
Here's what this version does:
- π·π₯ Handles the same photo and video formats as Option A
- π Sorts everything by timestamp, then renames in that order
- π’ Uses the same naming pattern, e.g.
0001_20260710_101523.jpg - πΎ Creates no new folder and no copies, so there is no extra disk usage
- π§Ύ Saves a
rename_log.csvfile listing every old and new name, so you can trace the originals - π§ͺ Offers a preview mode that shows the new names without changing anything
Step 1: Preview first (recommended)
Open PowerShell and run this preview. It uses -WhatIf, so it only shows what would be renamed and changes nothing. If PowerShell warns you about pasting multiple lines, choose Paste anyway — that's a normal Windows prompt.
$src = "C:\Users\Videos\Alicante julio 2026"
$files = @(Get-ChildItem $src -File |
Where-Object { $_.Extension -match '^\.(jpg|jpeg|png|heic|mp4|mov|avi|m4v|mts|m2ts)$' } |
Sort-Object LastWriteTime)
$i = 1
foreach ($f in $files) {
$new = "{0:D4}_{1:yyyyMMdd_HHmmss}{2}" -f $i, $f.LastWriteTime, $f.Extension.ToLower()
Rename-Item -LiteralPath $f.FullName -NewName $new -WhatIf
$i++
}
Step 2: Run the real rename
If the new names look right, run this version. It renames the files in the same folder and writes the log file.
$src = "C:\Users\Videos\Alicante julio 2026"
$files = @(Get-ChildItem $src -File |
Where-Object { $_.Extension -match '^\.(jpg|jpeg|png|heic|mp4|mov|avi|m4v|mts|m2ts)$' } |
Sort-Object LastWriteTime)
$i = 1
$log = foreach ($f in $files) {
$new = "{0:D4}_{1:yyyyMMdd_HHmmss}{2}" -f $i, $f.LastWriteTime, $f.Extension.ToLower()
[pscustomobject]@{ Old = $f.Name; New = $new }
Rename-Item -LiteralPath $f.FullName -NewName $new
$i++
}
$log | Export-Csv "$src\rename_log.csv" -NoTypeInformation -Encoding UTF8
Step 3: Check the result
Open the folder in Explorer. Your photos and videos are still in the same place, now numbered in chronological order:
0001_20260710_101523.jpg
0002_20260710_101601.mp4
0003_20260710_101745.jpg
0004_20260710_102012.mp4
rename_log.csv
Important notes for Option B
- Run it only once. If you run it again, the already-renamed files are renumbered, and you can get duplicate-name errors.
- Renaming cannot be undone automatically. Keep
rename_log.csvif you may need the original names later. - Already ran Option A by mistake? Check that your originals are still in the main folder, delete the
SORTEDfolder, and empty the Recycle Bin if you deleted it from Explorer — the space isn't freed until then. Then use Option B. - Not sure? Back up the folder to an external drive first, or use Option A.
Generate the Command for Your Own Folder
Paste your folder path below, choose the option you want, and the tool builds the PowerShell command for you.
Paste a folder path above to generate the command...
A More Accurate Option: Reading Real Capture Metadata
The scripts above sort by file timestamp, which works well for most single-device situations. But if your files came from multiple sources — a DJI drone, a phone, maybe a separate camera — and you need the exact capture time down to the second, a more advanced version reads the embedded metadata directly instead of relying on the file system. This is the recommended approach when timestamps must be perfectly accurate across mixed devices.
Getting the Sorted Files Into Shotcut
Once your files are sorted (in the SORTED folder for Option A, or in the original folder for Option B), the next question is how to bring hundreds of ordered files into Shotcut without losing that order. A few notes on this:
- Shotcut's Open File button (top-left) is designed for opening media files, but selecting hundreds of files at once through this dialog can scramble the order you worked hard to create.
- Instead, for large batches, use View → Playlist to open the Playlist panel, then add your sorted files there. Because they're already numbered sequentially, they'll load in the correct order.
- From the Playlist, you can then drag the files onto the Timeline in that same order, ready for editing.
Quick Recap
- Choose your method: Option A copies files into a new
SORTEDfolder (safest, but needs extra disk space); Option B renames files in place (no duplicates, no extra space). - For Option B, run the
-WhatIfpreview first, then the real rename once, and keeprename_log.csvas a record of the original names. - Open Shotcut and use View → Playlist rather than Open File for large batches.
- Add the sorted files to the Playlist, then drag them to the Timeline in order.
With this workflow, a folder of hundreds of mixed photos and videos becomes a clean, chronological sequence ready for editing — no manual renaming, no guesswork about what happened first, and, if you choose Option B, no duplicate files eating up your disk.
Watch the Final Result
Here's the finished video, edited from the sorted footage described above:
No comments:
Post a Comment