Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- #/home/clockworkpc/bin/screencast.py
- # Released under a GPLv3 Licence by Clockwork PC 2013
- # www.clockworkpc.com.au
- # You are entitled to the following four freedoms:
- # Freedom 0: To run this program for any purpose
- # Freedom 1: To study how this program works and change it to make it do what you wish
- # Freedom 2: To redistribute copies so you can help your neighbour
- # Freedom 3: To distribute copies of your modified version to others
- import os, datetime
- now = datetime.datetime.now()
- nowstring = str(now.strftime("%Y-%m-%d_%A_%H:%M:%S"))
- binFolder = os.getenv("HOME") + "/Videos/Desktop_Recording/" + nowstring + "/"
- videoStream = binFolder + "desktop_recording_on_" + nowstring + ".mkv"
- audioStream = binFolder + "microphone_input_on_" + nowstring + ".mp3"
- mergedVideo = binFolder + "screencast_on_" + nowstring + ".mkv"
- os.system("mkdir " + binFolder)
- os.system("gnome-terminal -x ffmpeg -f x11grab -r 30 -s 1366x768 -i :0.0 -c:v libx264 -threads 0 " + videoStream)
- os.system("gnome-terminal -x ffmpeg -f alsa -ac 2 -i pulse " + audioStream)
- convertPrompt = input("""Do you want to merge the streams?
- 1. Yes
- 2. No
- Please enter your choice: """)
- if convertPrompt == 1:
- os.system("gnome-terminal -x ffmpeg -i " + videoStream + " -i " + audioStream + " -b 5000k " + mergedVideo)
- else:
- exitQuestion = input("Are you done? (Press 1) ")
- if exitQuestion == 1:
- exit()
- else:
- exit()
- exitQuestionFinal = input("Are you done? (Press 1) ")
- if exitQuestionFinal == 1:
- exit()
- else:
- exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement