Advertisement
clockworkpc

Clockwork PC Webcasting Script 04

Dec 8th, 2011
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.86 KB | None | 0 0
  1. #!/usr/bin/python
  2. #/home/clockworkpcasus/Documents/bin/shell.py
  3.  
  4. # Released under a GPLv3 Licence by Clockwork PC 2011  
  5. #
  6. # www.clockworkpc.com.au
  7. #
  8. # You are entitled to the following four freedoms:
  9. # Freedom 0: To run this program for any purpose
  10. # Freedom 1: To study how this program works and change it to make it do what you wish
  11. # Freedom 2: To redistribute copies so you can help your neighbour
  12. # Freedom 3: To distribute copies of your modified version to others
  13.  
  14. import os
  15.  
  16. # Make sure that the necessary folders have been created [for the convenience of anyone using this script from scratch]
  17. os.system("mkdir -p ~/Videos/Vlog ~/Videos/VlogAudio ~/Videos/Screencasts")
  18.  
  19. # Record desktop using FFmpeg x11grab in a Gnome Terminal window using a differently coloured profile in order to differentiate it on screen from the other gnome-terminal window
  20. os.system("gnome-terminal --window-with-profile=x11grab -x ffmpeg -f x11grab -r 30 -s 1280x720 -i :0.0 -b 1000k ~/Videos/Screencasts/x11grab_$(date +%F_%A_at_%H:%M:%S).mkv")
  21.  
  22. # Record webcam and microphone using FFmpeg
  23. os.system("ffmpeg -f alsa -ac 2 -i pulse -acodec pcm_s16le -f video4linux2 -s 1280x720 -r 30 -b 1000k -i /dev/video0 -vcodec libx264 -preset ultrafast -crf 18 ~/Videos/Vlog/vlog_$(date +%F_%A_at_%H:%M:%S).mkv")
  24.  
  25. # Define the folders that the respective MKV video files are saved into
  26. x11grabFolder = os.getenv("HOME")+"/"+"Videos/Screencasts/"
  27. vlogFolder = os.getenv("HOME")+"/"+"Videos/Vlog/"
  28. vlogAudioFolder = os.getenv("HOME")+"/"+"Videos/VlogAudio/"
  29.  
  30. # Define the files to be opened when launching OpenShot
  31. templateFolder = os.getenv("HOME")+"/"+"Videos/MyVlog/Template/"
  32. templateFolderThumbnail = templateFolder + "thumbnail/"
  33. templateIntroClipCPC = templateFolder + "cpc_intro.mov "
  34. templateIntroClipAlex = templateFolder + "introalex.mov "
  35. templateBlackScreen = templateFolder + "blackscreen.png "
  36. templateCCalex = templateFolderThumbnail + "alexgarbercc.svg "
  37. templateCCmusic = templateFolderThumbnail + "ccmusic.svg "
  38. templateCCclockworkpc = templateFolderThumbnail + "clockworkpccc.svg "
  39.  
  40. os.system("ffmpeg -i " + vlogFolder + "`ls -lrt ~/Videos/Vlog | awk '{ f=$NF }; END{ print f }'` " + vlogAudioFolder + "audio__$(date +%F_%A_at_%H:%M:%S).mp3")
  41.  
  42. # Open OpenShot with the two files in the Project Files windows area (or add them if OpenShot is already open)
  43. os.system("gnome-terminal -x audacity " + vlogAudioFolder + "`ls -lrt ~/Videos/VlogAudio | awk '{ f=$NF }; END{ print f }'`")
  44.  
  45. os.system("openshot " + x11grabFolder + "`ls -lrt ~/Videos/Screencasts | awk '{ f=$NF }; END{ print f }'` " + vlogFolder + "`ls -lrt ~/Videos/Vlog | awk '{ f=$NF }; END{ print f }'` " + vlogAudioFolder + "`ls -lrt ~/Videos/VlogAudio | awk '{ f=$NF }; END{ print f }'` " + templateIntroClipCPC + templateIntroClipAlex + templateBlackScreen + templateCCalex + templateCCmusic + templateCCclockworkpc)
  46.  
  47. exit()
  48.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement