-
Notifications
You must be signed in to change notification settings - Fork 0
/
copyFrames.ps1
39 lines (22 loc) · 1.56 KB
/
copyFrames.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
## Script to duplicate pictures into directory, mainly for use in creating video from still images
## Created 2-14-2020 by Caleb Williams
$frames = Get-ChildItem '' # Literal path to picures you want to duplicate. Directory can contain multiple files
$p = '' # Literal path to directory to put duplicates into
$index = 0 # Starting index for While loop
$totalFrames = 7200 # Total number of final duplicates
$totalIndex = 3600 # This number should be $totalFrames value divided by total number of pictures in $frames directory
$frameIndex = 0 # This is used to account for case where more than one file is located in $frames
function copyFiles(){
While ($index -lt $totalIndex){
$progressPercent = ( $index / $totalIndex)*(100)
$percent = $progressPercent | % { '{0:0.##}' -f $_ }
Write-Progress -Activity "Copying files..." -Status "$percent% Percentage Complete." -PercentComplete $percent
foreach($frame in $frames) {
Write-Progress -Id 1 -Activity "Processing frames:" -Status "frame: $frameIndex"
Copy-Item -Path $frame.FullName -Destination ($p + ('frame_' + $frameIndex.ToString()) + '.tif')
$frameIndex += 1
}
$index += 1
}
}
copyFiles