Advertisement
clockworkpc

Clockwork PC Webcasting Script (Python)

Dec 8th, 2011
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.41 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. # Record desktop using FFmpeg x11grab
  17. os.system("gnome-terminal -x ffmpeg -f x11grab -r 30 -s 1280x720 -i :0.0 -b 1000k ~/Videos/Screencasts/x11grab_$(date +%F_%A_at_%H:%M:%S).mkv")
  18.  
  19. # Record webcam and microphone using FFmpeg
  20. 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")
  21.  
  22. # Define the folders that the respective MKV video files are saved into
  23. x11grabFolder = os.getenv("HOME")+"/"+"Videos/Screencasts/"
  24. vlogFolder = os.getenv("HOME")+"/"+"Videos/Vlog/"
  25.  
  26. # Open OpenShot with the two files in the Project Files windows area (or add them if OpenShot is already open)
  27. 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 }'`")
  28.  
  29. exit()
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement