[ale] screen recorder with video for ubuntu

Brian Pitts brian at polibyte.com
Wed Jun 9 10:29:03 EDT 2010


On 06/09/2010 02:10 AM, Narahari 'n' Savitha wrote:
> Here is what I am planning to do.  At a given time my firefox will start
> up and with imacros help login to a page and start video streaming ON LINUX.
>
> I then want to capture a region with audio.  This should be saved to
> folder, which I plan to use myth to stream to my myth client an thereby
> to the tv.
>
> All this should happen in the middle of the night.
>
> Any ideas in that front ?
>

For the video, you can capture a region with gstreamer. I think the 
syntax would be like the snippet below. Of course, theora video in an 
ogg container might not be the best format for you, but that is easy to 
change.

'gst-launch ximagesrc startx=0 endx=100 starty=0 endy=100 ! 
video/x-raw-rgb,framerate=5/1 ! ffmpegcolorspace ! theoraenc ! oggmux ! 
filesink location=desktop.ogg'

For the audio, you can record with parec. This dumps raw data, so you'll 
want to convert it with something like sox. See the manpages of pacat 
and sox for details. The snippet below just worked for me, but you'll 
have to change the source to be the right monitor device on your system. 
You can see these with 'pactl list'; I've linked to a script that will 
extract the most recently added one. [0] Of course, you may want to 
change the output from wav to another container and codec.

'parec -d alsa_output.pci-0000_00_1b.0.analog-stereo.monitor | sox -t 
raw -r 44k -sLb 16 -c 2 - desktop.wav'

The tools and steps for muxing the audio and video together will depend 
on what codecs and containers you use. Which ones are best for you will 
depend on what myth best supports, I guess.

It's probably possible to do the audio and video with gstreamer all at 
once, but I don't have time to figure it out. Constructing those 
pipelines can get confusing and may require scripting with the gstreamer 
api rather than using the gst-launch tool.

[0] http://outflux.net/software/pa-clone

-- 
All the best,
Brian Pitts


More information about the Ale mailing list