guest@dotshare [~/groups/shells/bash] $ ls screencastersh/ | cat

screencaster.sh (scrot, raw, dl) (+1 likes)

ratakruel Jan 08, 2013 (shells/bash)

SCROT

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# script para producción de screencast
# dependencias:
# ffmpeg, mplayer

read -p "Nombre del Screencast (sin extensión)-->" myarchivo

########################config##########################
mypath="/home/ratakruel/videos/screencast/"
extension=".mkv"
inRES=1024x600
outRES=720:480
########################################################

out=$mypath$myarchivo$extension
cd $mypath

###########generando archivos temporales################
aud="aud.mkv"
vid="vid.mkv"

###########grabacion de audio y pid#####################
ffmpeg -f alsa -ac 1 -i plughw:0,0 $aud &
audPID=$!

###########grabacion de webcam y pid####################
mplayer tv:// &
webPID=$!

###########grabacion de screen y pid####################
ffmpeg -f x11grab -s $inRES -i :0.0 -vcodec libx264 -vf scale=$outRES $vid &
vidPID=$!

###########esperando...             ####################
read -p "quit"

###########parando audio y video por sus PID's #########
kill -n 2 $audPID
kill -n 2 $webPID
kill -n 2 $vidPID
echo "guardando screencast en $out ..."

###########combinando archivos      ####################
ffmpeg -i $aud -i $vid -acodec copy -vcodec copy $out

###########limpiando temporales     ####################
rm $aud
rm $vid

CLICK TO VIEW

x

Notes

this is a simple bash script for make screencast over GNU/Linux with low resources consuption and only ffmpeg and mplayer dependencies.

this still have latency sync in the webcam.

enjoy!

Comments

Cram said about 8 years ago

nice

edited about 8 years ago