Skip to content

Instantly share code, notes, and snippets.

@neerajvashistha
Last active May 13, 2016 01:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neerajvashistha/2c7c7a7bcc01c5723f511b714ec946e3 to your computer and use it in GitHub Desktop.
Save neerajvashistha/2c7c7a7bcc01c5723f511b714ec946e3 to your computer and use it in GitHub Desktop.
fname=`date +"%d.%m.%Y_%H:%M:%S_%P"`.'_screencast.mp4'
input_width=320 # preselect width an height of video source
input_height=240 # other possible combinations: 640/480; 320/240
ASPECT=43 # '169' (16:9) or '43' (4:3); this value affects video playback with mplayer or vlc only!
V_NORM="pal" # preselect TV-norm 'PAL' oder 'NTSC'
DEV_VIDEO="/dev/video0"
zenity --question --text "Record Webcam video(if NO, Screencast only)?"
if [ "$?" != 0 ]; then #1
vlc screen:// :screen-fps=20 :screen-follow-mouse :live-caching=300 :input-slave=alsa://hw:1,0 :sout="#transcode{vcodec=h264,vb=384,fps=5,acodec=mpga}:duplicate{dst=std{mux=mp4,access=file,dst='$fname'}}" &
#cvlc --jack-input-auto-connect screen:// --screen-fps=25 --input-slave pulse://jack_in --sout "#transcode{venc=x264,quality:50,scale=1,fps=25,acodec=mp3,ab=128,channels=2, samplerate=44100}:duplicate{dst=std{access=file,mux=mp4,dst=nowardev.mp4}}}" &
else #0
vlc --video-on-top --qt-minimal-view -vvv v4l2://${DEV_VIDEO}:width=$input_width:height=$input_height:norm=${V_NORM} ${V_ASPECT} &
vlc screen:// :screen-fps=20 :screen-follow-mouse :live-caching=300 :input-slave=alsa://hw:1,0 :sout="#transcode{vcodec=h264,vb=384,fps=5,acodec=mpga}:duplicate{dst=std{mux=mp4,access=file,dst='$fname'}}" &
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment