Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- #/home/clockworkpcasus/Documents/bin/shell.py
- # Released under a GPLv3 Licence by Clockwork PC 2011
- #
- # 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
- # Make sure that the necessary folders have been created [for the convenience of anyone using this script from scratch]
- os.system("mkdir -p ~/Videos/Vlog ~/Videos/VlogAudio ~/Videos/Screencasts")
- # 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
- 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")
- # Record webcam and microphone using FFmpeg
- 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")
- # Define the folders that the respective MKV video files are saved into
- x11grabFolder = os.getenv("HOME")+"/"+"Videos/Screencasts/"
- vlogFolder = os.getenv("HOME")+"/"+"Videos/Vlog/"
- vlogAudioFolder = os.getenv("HOME")+"/"+"Videos/VlogAudio/"
- # Define the files to be opened when launching OpenShot
- templateFolder = os.getenv("HOME")+"/"+"Videos/MyVlog/Template/"
- templateFolderThumbnail = templateFolder + "thumbnail/"
- templateIntroClipCPC = templateFolder + "cpc_intro.mov "
- templateIntroClipAlex = templateFolder + "introalex.mov "
- templateBlackScreen = templateFolder + "blackscreen.png "
- templateCCalex = templateFolderThumbnail + "alexgarbercc.svg "
- templateCCmusic = templateFolderThumbnail + "ccmusic.svg "
- templateCCclockworkpc = templateFolderThumbnail + "clockworkpccc.svg "
- 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")
- # Open OpenShot with the two files in the Project Files windows area (or add them if OpenShot is already open)
- os.system("gnome-terminal -x audacity " + vlogAudioFolder + "`ls -lrt ~/Videos/VlogAudio | awk '{ f=$NF }; END{ print f }'`")
- 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)
- exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement