Private-Recorder

I needed a solution to do a basic recording of audio and video on skype. This page describes usage of a simple (python) code I have written to record the skype video call. The approach is 'heath-robinson' using 'recordmydesktop', pulseaudio and v4l2loopback to record a skype call. The code outputs two separate streams: one stream is their webcam and audio, the other is yours. As a consequence, you need the v4l2loopback kernel module installed. If you're interested in the name, jump to the bottom of the page.

code for enabling recording with a single click is available here:

https://gitorious.org/private-recorder/skype-record

Alternatives

Skype is not free software. The workaround below is completely unnecessary is you choose a decent, free alternative to skype.

Motivation

The ideal result for me is to have two video files: one file from my webcam and from my mic. The second from my callers webcam and mic. I'm prepared to make to with what skype sends over for my callers video and audio.

Usage

On Ubuntu install the dependencies:

sudo apt-get install recordmydesktop

I want to record two separate streams: one for the audio/video of the person on the other end of the line, another stream for you and your voice. To achieve this, you need 'v4l2loopback' module. I've had problems with the ubuntu v412loopback-dkms. I recommend https://github.com/umlaeute/v4l2loopback. Instructions on building and installing 0.5.0 are beyond the scope of this document. Once this is complete, and before you start skype:

1. use the v4l2loopback kernel module to create 3 additional virtual video devices:

sudo modprobe v4l2loopback devices=3 max_buffers=2

assuming you don't already have an exotic app (like WebcamStudio installed) and only one physical webcam, you will now have your real webcam: /dev/video0 and virtual devices dev/video1, /dev/video2, and /dev/video3

2. Clone the output of /dev/video0 to /dev/video1, /dev/video2, and /dev/video3:

gst-launch-0.10 v4l2src device=/dev/video0 ! tee name=t_vid ! queue ! v4l2sink sync=false device=/dev/video1 t_vid. ! queue ! v4l2sink sync=false device=/dev/video2 t_vid. ! queue ! v4l2sink sync=false device=/dev/video3

Your webcam will start (if the webcam has a light on it, it will illuminate) and the webcam output will be available on all the virtual devices (/dev/video1, /dev/video2, and /dev/video3). If this works - excellent! If not see below for troubleshooting.

3. OPTIONAL watch yourself in a separate window with:

gst-launch-0.10 v4l2src device=/dev/video3 ! xvimagesink

4. Start skype.

Configure skype to use /dev/video1 . Test this video device works in skype. You will have one video device free: /dev/video2. Private-Recorder uses /dev/video2 to record you from your webcam.

5. Start a new terminal, cd to the Private-Recorder directory and run './skype-record.py'.

So at this point, skype is running, and you have this little window above open too. When Private-Recorder is running you will see a window with 'start record' and 'stop record' button.

Tips on usage:

    • Test before you use. And test again.

    • Before you press 'start recording' move the window with the person you are calling into position. Once recording starts, you must not move the skype video window.

    • Once you press 'stop recording' skype record must do some video post processing. Leave the window with the button on it open until you see instructions in the terminal to let you know it is finished. Closing the skype-record early can destroy the recorded video.

    • After a successful recording two video files (beginning with 'me_' and 'them_') will be created in the directory that you ran the code from.

Known issues

I've tested this on Ubuntu 11.10, 12.04, F17. I would appreciate reports of success - or failure.

    • The stream that recordmydesktop does a encoding phase once you click 'stop recording'. Do not close the skype-record before this phase is complete.

    • It seems you need a fair bit of umph to record from modern, hi-def webcams.

    • v4l2loopback seems to have some issues that mean you might get a seg fault when you're trying to copy the contents of /dev/video0 with the gst command. I've found that using 'max_buffers=2' can help. The instructions now suggest this max_buffers by default.

    • gstreamer may struggle to start, complaining:

      • ERROR: Pipeline doesn't want to pause.

      • ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not negotiate format

      • Additional debug info:

      • gstbasesrc.c(2830): gst_base_src_start (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:

    • I think this has something to do the with the output of your webcam. I've had success by adding videorate into the pipeline. So the gst command becomes:

      • gst-launch-0.10 v4l2src device=/dev/video0 ! videorate ! tee name=t_vid ! queue ! v4l2sink sync=false device=/dev/video1 t_vid. ! queue ! v4l2sink sync=false device=/dev/video2 t_vid. ! queue ! v4l2sink sync=false device=/dev/video3

    • If that doesn't work, you might try adding ffmpegcolorspace and or videoscale.

    • Alternatively, I have a logitech hd 525 something. I find the best gstreamer string is:

      • gst-launch-0.10 v4l2src device=/dev/video0 ! ffmpegcolorspace ! video/x-raw-yuv,format=\(fourcc\)YUY2,width=640,height=480 ! videorate ! tee name=t_vid ! queue ! v4l2sink sync=false device=/dev/video1 t_vid. ! queue ! v4l2sink sync=false device=/dev/video2 t_vid. ! queue ! v4l2sink sync=false device=/dev/video3

About the name

Private-Recorder is now the name of this project. The intention is to emphasis the purpose of this project is to provide recordings from your desktop in private, freely, without a third-party. It is not a skype product, skype is a supported service. Google+ will be supported in future.