Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. New-Item -ItemType directory -Path \\192.168.1.100\Media\CamRec\scriptbackup
  2. # Create a new temp folder
  3.  
  4. copy-item \\192.168.1.100\Media\CamRec\Photos\* \\192.168.1.100\Media\CamRec\scriptbackup
  5. # Copy each item from source folder to new temp one
  6.  
  7. cd \\192.168.1.100\Media\CamRec\scriptbackup
  8. $i = 1
  9. Get-ChildItem *.jpg | %{Rename-Item $_ -NewName ('pic{0:D4}.jpg' -f $i++)}
  10. # Move to the temp and rename them all sequentially (From 1 to infinity) starting with 'pic'
  11.  
  12. 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"
  13. # encode sequential shots into a .mp4 video, overwriting if one is currently there to keep it up to date with new film
  14.  
  15. Remove-Item  -Path \\192.168.1.100\Media\CamRec\scriptbackup -Force -Recurse
  16. # 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