Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- New-Item -ItemType directory -Path \\192.168.1.100\Media\CamRec\scriptbackup
- # Create a new temp folder
- copy-item \\192.168.1.100\Media\CamRec\Photos\* \\192.168.1.100\Media\CamRec\scriptbackup
- # Copy each item from source folder to new temp one
- cd \\192.168.1.100\Media\CamRec\scriptbackup
- $i = 1
- Get-ChildItem *.jpg | %{Rename-Item $_ -NewName ('pic{0:D4}.jpg' -f $i++)}
- # Move to the temp and rename them all sequentially (From 1 to infinity) starting with 'pic'
- cmd.exe /c "ffmpeg -r 100 -f image2 -s 1920x1800 -i \\192.168.1.100\Media\CamRec\scriptbackup\pic%04d.jpg -vcodec libx264 \\192.168.1.100\Media\CamRec\Movies\Timelapse.mp4 -y"
- # encode sequential shots into a .mp4 video, overwriting if one is currently there to keep it up to date with new film
- Remove-Item -Path \\192.168.1.100\Media\CamRec\scriptbackup -Force -Recurse
- # remove the temp directory because there is no need to keep renamed copies of source images
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement