Advertisement
AverageMan

Raspberry Pi Slow Motion

Jul 5th, 2015
426
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.88 KB | None | 0 0
  1. import os
  2. import time
  3.  
  4. print 'Starting programme'
  5. time.sleep(2)
  6.  
  7. ##### Record the slow motion video #####
  8. # '-w' sets the width  # '-h' sets the height
  9. # '-fps' sets the frames per second (90 maximum - for slow motion)
  10. # 't' sets the time in milliseconds (30000 = 30 seconds)
  11. # '-o' sets the output filename
  12.  
  13. print 'Recording started (30 seconds)'
  14. os.system("raspivid -w 640 -h 480 -fps 90 -t 30000 -o slowmotion.h264")
  15.  
  16. print 'Recording complete. Please wait...'
  17. time.sleep(2)
  18.  
  19. ##### Convert the raw recorded video file to playable mp4 #####
  20. # '-add' is the name of the raw video we want to convert
  21. # The second filename is the output mp4 file (we use the same name followed by '.mp4')
  22.  
  23. print 'Converting video. Please wait...'
  24. os.system("MP4Box -add slowmotion.h264 slowmotion.mp4")
  25.  
  26. print 'Video conversion complete'
  27. time.sleep(2)
  28.  
  29. print 'Closing programme'
  30. time.sleep(2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement