Screen video (screencast) recording on Linux - linux

I was trying to record video of all the monitors or a selection, so was wondering what to use for Linux.
The thoughts that came to mind were screenshot the screen a bunch but this probably isnt the right way to go about it.
I looked at the Cairo docs but can't find anyhting. On Windows I found DirectShow and OSX I found AVFoundation.
edit:
i just came across something: XvGetVideo would this be an option?

You can check out ffscreencast with the --dry parameter which will show you the commands that would be issued. Looks nice for learning.
Did it under linux and it showed me it was using x11Grab

Related

Extended desktop in Linux

My goal is to have an extended desktop like in windows. Linux only uses my second monitor as a mirror, which is useless. I have searched a lot on google and SO for a way to get this right. I want linux to use both my monitors for one extended desktop, not as a mirror. As of yet I have not found out how to do this. Any help appreciated, thanks.
OK so a colleague explained it to me. Apparantly xrandr comes with almost all linux distributions. The proper way to use xrandr to set multiple monitors to display a different part of the same desktop is as follows:
xrandr
Shows you the names and dimensions of your displays. Say VGA1 and VGA2. Then if VGA1 is the screen on the left and you want VGA2 to extend it to the right you use:
xrandr --output VGA2 --right-of VGA1
Thats it.
Was looking for this on google and SO for hours, finally its working! Hope this will help other people as well. Dont know how to save this setting yet and I dont know if this is the most elegeant/best way to do this.
When you know the answer its easier finding other answers. Here are two sources that show how to save this setting as well. (although that does not work on my system as the files they point to cant be found)......
intel guide to xrandr
thinkwiki guide to xrandr
xrandr --output VGA2 --right-of VGA1
You get xrandr help if the first option is misspelled.
After you get your displays extended as #Leo explains, you can fine tune their placement using arandr from the terminal. It brings up a gui for xrandr.

show vim command keys on live demo

I'm going to make a live presentation showing vim capabilities. It's essential to show the audience command keys that I press. I know I can use showcmd, but I find its output to small and to hard to notice to use it in live demo. Is there any way to make it easier to notice? It could be something similar to command keys shown in Railscasts (for instance in this video, 1:11). Do you know anything like that?
For X11, there is key mon. I'm sure there are similar tools for other systems. Otherwise, you could use some sort of virtual keyboard which also shows keypresses.
Here's a recent vimcast article about Drew Neil tackling the same issue -
Vimprint Source, Article
Relevant accompanying talk -
Video, Slides
There is also Screenkey, inspired from key-mon.

How to programmatically invert screen colors in Linux

In Ubuntu, for example, you can use Super-M to invert the screen colors (requires desktop effects, see [1]). Other OSes have similar abilities, although I'm not really concerned with anything other than Linux.
Which API should I look into if I want to write a simple program that, when run, inverts the screen colors?
The language that I use the API from doesn't particularly matter to me. I am familiar enough with C/C++/Bash/Perl/Python that I can hack this up in whatever language has the easiest access to this API. Working on Ubuntu is required, working on other similar *nixes is not terribly important.
[1] https://help.ubuntu.com/community/KeyboardShortcuts#Desktop%20Effects%20enabled%20shortcuts
You could use xcalib to do what you want.
For example, a simple bash script to invert the screen colors would look like this:
#!/bin/bash
xcalib -invert -alter
Here are scripts and instructions for shifting colors using compton: https://github.com/vn971/linux-color-inversion
xrandr-invert-colors worked out of the box for me.
xcalib does not work for me using xorg and a tiling window manager, with an external display and gives me the following error: "Unable to get a display calibration".
Credit to Imat.

Displaying WebCam video with Qt

I'm using Qt 4.5 (2009.03) on Linux Gnome (Ubuntu 9.04) and would like to display video captured by my webcam in a Phonon::VideoWidget of my Qt application.
I have a first implementation using the v4l2 API where I do the YUV2 to RGB conversion and fill a QImage my self. It works well but it is not very efficient. A collegue used gStreamer to do the same thing and it was much much faster.
Since then I found out about phonon and would like to use it. Everything is configured and set up except for the binding to the webcam device as source.
I should create a MediaSource object but I don't know how to configure it. Any help would be greatly valuable.
Edit: The Phonon overview explains that it is not supported yet. But I need a solution.
I know its little bit late for this question. but I was looking for the same thing and could not find pure qt solution. Here is my solution https://sourceforge.net/p/qtv4lcapture/code/HEAD/tree/
If your goal is to display the YUV image on the screen you can use the OpenGL module. Implement the conversion as a fragment shader. If you want to do something else like save the converted image to a file then it is not a good idea.
Some links:
http://doc.qt.digia.com/4.6/qglshaderprogram.html
http://doc.qt.digia.com/4.6/qglshader.html
http://www.fourcc.org/source/YUV420P-OpenGL-GLSLang.c (the conversion is in the FProgram string)
Maybe you can take a look the way kapture was implemented.

DirectDraw Overlays

Does anyone have a working example (code) of a DirectDraw overlay? Like something moving on the screen. I have been trying to find an example of DirectDraw overlaying usage and was unable to.
Thank you.
Try some of these:
from gamedev.net
from fourcc.org
[Edit] A bit more googling suggests you might want D3D Hooking? ..or have your tried the DirectDraw Overlay Library on CodePlex?
http://www.gamedev.net/community/forums/topic.asp?topic_id=359319
This code should work (I tried it when it comes out and it worked totally fine), its a little old and I don't know if it actually build with the actual SDK thought. (you maybe have to use an old SDK)

Resources