Advertisement
clockworkpc

Clockwork PC Webcasting Script with OpenShot auto-open

Dec 6th, 2011
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.47 KB | None | 0 0
  1. #!/bin/bash
  2. #Filename:webcast.sh
  3. #Released under a GPLv3 Licence by Clockwork PC
  4.  
  5. # Naming the folders for the Vlog (Webcam + Audio) and Screencast (X11grab)
  6.  
  7. a="Videos/Vlog/"
  8. b="Videos/Screencasts/"
  9.  
  10. # Run FFmpeg x11grab to a pre-set resolution of 1280x800 on monitor 1 in a separate terminal window to allow the main recording below to start simultaneously AND to be finished separately.  (If you run them as simultaneous processes you basically have to killall ffmpeg to make it stop, thereby losing all of your recording)
  11.  
  12. gnome-terminal -x ffmpeg -f x11grab -r 30 -s 1280x800 -i :0.0 -b 1000k ~/Videos/Screencasts/x11grab_$(date +%F_%A_at_%H:%M:%S).mkv
  13.  
  14. # Run FFmpeg to record from the system-defined audio-input (e.g. microphone) and from the primary webcam (/dev/video0) at a resolution of 1280x800.  Unfortunately the frame rate gets set to 10 fps rather than 30, I'm not sure how to change it.  But it does work.
  15.  
  16. ffmpeg -f alsa -ac 2 -i pulse -acodec pcm_s16le -f video4linux2 -s 1280x800 -r 30 -b 1000k -i /dev/video0 -vcodec libx264 -preset ultrafast -crf 18 ~/Videos/Vlog/vlog_$(date +%F_%A_at_%H:%M:%S).mkv &&
  17.  
  18. # Use ls and awk to find the latest Vlog and Screencast files.
  19.  
  20. c=`ls -lrt ~/Videos/Vlog | awk '{ f=$NF }; END{ print f }'`
  21. d=`ls -lrt ~/Videos/Screencasts | awk '{ f=$NF }; END{ print f }'`
  22.  
  23. # Define the location + filename of the Vlog and Screencast files.
  24.  
  25. e="${a}${c}"
  26. f="${b}${d}"
  27.  
  28. # Open both files in a new OpenShot project
  29.  
  30. openshot $e $f
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement