Screen capture using ffmpeg in Debian Wheezy

I made a simple screen capture script that uses ffmpeg to create MPEG-4 video file. I replaced two script lines from the original script. If you are using ALSA sound driver, replace ‘-f alsa -i pulse’ to ‘-f alsa -i hw:0,0’.
xwininfo -root | grep ‘geometry’ | awk ‘{print $2;}’ finds current screen resolution. I hard coded it to make the script short.

# capture screen to mp4 video file


# alsa -ac -i hw:0,0
# xwininfo -root | grep 'geometry' | awk '{print $2;}'
# 1440x900+0+0
ffmpeg -f alsa -i pulse \
-f x11grab -s 1440x900+0+0 \
-r 24 -i :0.0 -sameq -f mpeg -ar 48000 -s hd720 -y \

Converting video to image files
ffmpeg -i movie.mpg movie%d.jpg

I could convert an ebook to number of page images for printing. After capturing ebook reader on screen from the first page to the last, ran the following code to extract all images in a separate directory.

ffmpeg -i ../paida_lajin.mp4 -qscale:v 2 pl_%04d.jpg

About janpenguin

Email: k2.mountain [at] gmail [dot] com Every content on the blog is made by Free and Open Source Software in GNU/Linux.
This entry was posted in GNU/Linux and tagged , , , , , . Bookmark the permalink.

1 Response to Screen capture using ffmpeg in Debian Wheezy

  1. Wayne says:

    Thank you for the post. Usefull

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s