Sunday, March 31, 2013

Screencast on Debian Linux

Sometimes, I need to capture the screenshots and put them in a video. FFmpeg is very useful for recording what I do on the screen. The commands below can be used to record the video. Press q to end the recording.

The video file is saved in the current directory.

# screencast

# x.ogx is the music file
$ ffmpeg -i x.ogx \
-f x11grab -s `xdpyinfo | \
grep -i dimensions: | \
sed 's/[^0-9]*pixels.*(.*).*//' | \
sed 's/[^0-9x]*//'` -r 25 -i :0.0 -sameq screencast.avi




# mute: add no sound
# use -vol 0
$ ffmpeg -vol 0 \
-f x11grab -s `xdpyinfo | \
grep -i dimensions: | \
sed 's/[^0-9]*pixels.*(.*).*//' | \
sed 's/[^0-9x]*//'` -r 25 -i :0.0 -sameq screencast.avi




# the number after -vol adjusts the volume
$ ffmpeg -i x.ogx \
-vol 200 \
-f x11grab -s `xdpyinfo | \
grep -i dimensions: | \
sed 's/[^0-9]*pixels.*(.*).*//' | \
sed 's/[^0-9x]*//'` -r 25 -i :0.0 -sameq screencast.avi



# a.avi is original video
# b.avi is the modified version of the video
# x.ogx is the music

$ ffmpeg -i a.avi -i x.ogx \
-vcodec copy -acodec copy \
-acodec copy \
b.avi \
-newaudio


# References
# Muxing audio and video with ffmpeg
## http://cfc.kizzx2.com/index.php/muxing-audio-and-video-with-ffmpeg/
# Adding Audio Track to Video With Ffmpeg
## http://blog.noizeramp.com/2011/04/21/adding-audio-track-to-video-with-ffmpeg/
# VERY simple guide to grab desktop with FFMPEG
## http://ubuntuforums.org/archive/index.php/t-1710642.html
# What does "-vol" parameter mean in ffmpeg?
## http://ffmpeg.org/pipermail/ffmpeg-user/2011-May/000931.html
# FFmpeg
## http://www.ffmpeg.org/

No comments: