Thursday, January 2, 2014

Solution to record your Desktop Using FFMPEG in linux

Install ffmpeg packages in linux ( fedora, ubuntu and etc ) using installers (yum,apt-get and etc)

use the following command to record the Desktop :


ffmpeg -r 30 -s 1280x720  -f x11grab -i :0.0 -vcodec msmpeg4v2 -qscale 1 out.avi


But when we give resolution 1280x720 it will only take that part of your Desktop ( or some it will not record when your Desktop resolution is less the specified ) for that problem we need use one small script to record the Desktop


cat > record_myDesktop.sh  << EOF
#!/bin/bash
cur_dis=$( xrandr | grep '*' )
res=$(echo $cur_dis |awk '{print $1}')
echo $cur_dis
echo "ffmpeg -r 30 -s $res -f x11grab -i :0.0 -vcodec msmpeg4v2 -qscale 1 out.avi"
ffmpeg -r 30 -s $res -f x11grab -i :0.0 -vcodec msmpeg4v2 -qscale 1 out.avi
EOF

chmod +x record_myDesktop.sh 

./record_myDesktop.sh

--

0 comments:

Post a Comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.