lunes, noviembre 01, 2010

Screen capture in linux, using ffmpeg

ffmpeg in ubuntu can be used in very simple way to capture directly from the X server in this way

TS=`date +%Y%m%d_%H%M`; ffmpeg -s 1024x600 -f x11grab -r 1 -i :0.0 -s 768x450 -vcodec flashsv sesion-$TS.flv

we indicate the original size (-s 1024x600) and the frame rate of grabbing (-r 1) that is and X grabbing (-f x11grab) the source screen (-i :0.0) and the desired video codec (-vcodec flashsv) o sea flashscreenvideo and the file format of the file container in this case flash video (.flv)

other example can be to obtain and avi using mpeg4 as video encoding

TS=`date +%Y%m%d_%H%M`; ffmpeg -s 1024x600 -f x11grab -r 1 -i :0.0 -s 768x450 sesion-$TS.avi

or using xvid codec

TS=`date +%Y%m%d_%H%M`; ffmpeg -s 1024x600 -f x11grab -r 1 -i :0.0 -s 768x450 -vcodec libxvid -aspect 16:9 -qmax 10 flashsv sesion-$TS.flv

we can omit the -qmax parameter or put a value between 2-31, 2 is the best quality

No hay comentarios.: