Rebuilding ffmpeg to create screencast in Ubuntu

I was assigned to record a screencast for demonstrating look-and-feel of a portal. By the way, my laptop is Ubuntu right now. I don't want to find another machine to do this job so I have to find a way to record my screen effectively. I found How to Create a Screencast in Ubuntu. This is a good article which helps me realize additional capability of ffmpeg. Anyway, the standard ffmpeg does not support this functionality so I have to recompile ffmpeg by myself. Well, I do not like this idea because I will have two versions of ffmpeg in different directory. So I continue finding and finally found how to rebuild ffmpeg in proper way. As a result, I combined 2 approaches as follows.

  1. Prepare all necessary packages to build ffmpeg from source

    $ sudo apt-get build-dep ffmpeg
  2. Install additional packages to build risky addons of ffmpeg

    sudo apt-get install liblame-dev libfaad2-dev libfaac-dev libxvidcore4-dev fakeroot
    sudo apt-get install build-essential xlibs-dev devscripts
  3. Get ffmpeg source

    sudo apt-get source ffmpeg
  4. Get x11grab patch

    wget http://un.sh.nu/screencasts/ffmpeg-0.4.9-p20051216.diff
  5. Apply the patch (You may get 2 failures in file configure. Don't worry. Edit the file manually will help.)

    cd ffmpeg_0.cvs20050918
    patch -Np1 -i ../ffmpeg-0.4.9-p20051216.diff
  6. Modify debian/rules to include below line

    confflags += --enable-x11grab
  7. Modify debian/changelog to describe about your modification and version number to prevent autoupdater override this package automatically

    ffmpeg (3:0.cvs20050918-5ubuntu1.x11grab) dapper; urgency=low

    * x11grab:
    + Add support for x11grab

    -- Sugree Phatanapherom <sugree@gmail.com> Wed, 21 Jun 2006 21:50:00 +0700
  8. Rebuild ffmpeg

    $ DEB_BUILD_OPTIONS=risky debuild -us -uc
  9. Install the package

    $ cd ..
    $ dpkg -i ffmpeg_0.cvs20050918-5ubuntu1.x11grab_i386.deb

Now I have a customized version of ffmpeg which supports x11grab extension for real-time recording screen and another audio source with the same build options of that in original ffmpeg compiled. In order to record a screencast, I just run below command.

$ ffmpeg -vcodec mpeg4 -b 1000 -r 10 -g 300 -vd x11:0,0 -s 1280x768 -an test.avi

where:

  • -vd x11:0,0 specify x11 as video device at offset x=0 and y=0
  • -b 1000 specify video bitrate
  • -r 10 specify video frame rate
  • -s 1280x768 specify video size
  • -an specify to exclude audio

If you want to record audio, just ignore -an and run ffmpeg under esddsp to make it run concurrently with other application properly. To resize the video, run below command.

$ ffmpeg -vcodec mpeg4 -b 1000 -r 10 -g 300 -i test.avi -s 800x600 test-800-600.avi

Now it's time to play.

$ mplayer -vo x11 test.avi

Happy screencast!

Technorati Tags: , , ,

Video Converter for Mac is

Video Converter for Mac is the most powerful Video Converter for Mac OS software which allows you to convert videos between popular video formats and audio formats. The easy-to-use Video Converter for Mac lets you to enjoy your videos on iPod, PSP, Mobile Phone, Zune, iPhone, Apple TV and MP4/MP3 player. This Video Converter for Mac allows you to set the destination, the name of output files.iPod Converter for Mac is the best Video to iPod Converter for Mac OS X software for you. With the iPod Converter for Mac you can easily convert popular video formats including FLV, MPEG1, MPEG2, DivX, Xvid, WMV, 3GP, 3G2, MOV, AVI, MPEG TS/TP (for HD Video), etc to iPod compatible MPEG-4 videos. And also it is not only and iPod Converter for Mac, but it can convert all popular videos to iPhone, Apple TV, PSP, PS3, Youtube (web), Creative Zen, iRiver PMP, Archos, MP4, various mobile phones and many other digital video and audio players.MP4 Converter for Mac is an excellent Mac MP4 converter which can not only convert MP4 to MP3, WMA, AAC, WAV, etc but also convert avi, flv, wmv, mpeg, divx etc to MP4 on Mac os x to enjoy your favourite video with MP4 Converter for Mac os. Compared with other mp4 converter Mac software, the MP4 Converter for Mac provides powerful edit functions, such as setting the output settings, cropping and trimming files, merging several files into one, etc. With this MP4 Converter for Mac, you can easily convert mp4 videos to varoius format for Mac.

How to download YouTube

How to download YouTube videos for Mac and convert the .FLV files on Mac OS? Here are the easy-to-use and top-user-rating YouTube Video Grabber Mac and Mac FLV converter tools. It is safe to install and no spyware or adware guarenteed.
With the YouTube Video Grabber Mac application, you can easily download youtube for mac and convert YouTube videos on your Mac OS. It can automatically detect the YouTube video files from the YouTube web pages you have opened and download multiple files once a time. YouTube Video Grabber Mac is a totally free download youtube videos for mac, because if you don’t want to convert downloaded videos to your mobile players, you don’t have to pay for it.
FLV Converter Mac is a powerful FLV Converter for Mac software which can convert FLV video files to all popular video formats and convert FLV to popular audio formats for Mac OS X users. FLV Converter Mac OS X softwrare supports all video popular formats indcluding FLV, MPG, MPEG1, MPEG2, MP4, 3GP, 3G2, MOV, AVI, Mpeg TS/TP (for HD Video), etc. The Mac FLV Converter can also convert FLV to MP3, WAV, OGG, 3GP, AAC and M4A, AC3, APE, etc audio.

Post new comment

The content of this field is kept private and will not be shown publicly.