Capture movie directly from N9/N950 screen
This article explains how to capture a movie directly from N9/N950 screen without a video camera
Article Metadata
Tested with
Compatibility
Article
Introduction
Putting together a video for the first release of http://code.google.com/p/voicetogoog/ running on Nokia N950, I ended up hacking up some command-line tools to capture directly from the screen of the handset.
I've long been doing screenshots via a gstreamer pipeline
gst-launch-0.10 ximagesrc num-buffers=1 ! ffmpegcolorspace ! pngenc ! filesink location=screenshot.png
And likewise I've found the following gstreamer pipelines useful for creating timelapse captures from the front and back cameras:
#front camera aegis-exec -a "GRP::video" -a "GRP::pulse-access" gst-launch-0.10 -v subdevsrc ! videorate ! video/x-raw-yuv,width=576,height=432,framerate=\(fraction\)1/15 ! ffmpegcolorspace ! jpegenc ! multipartmux ! filesink location=lapse1.mjpeg
#back camera aegis-exec -a "GRP::video" -a "GRP::pulse-access" gst-launch-0.10 -v subdevsrc camera-device=1 ! videorate ! video/x-raw-yuv,width=576,height=432,framerate=\(fraction\)1/15 ! ffmpegcolorspace ! jpegenc ! multipartmux ! filesink location=lapse1.mjpeg
Putting it All Together
Combining these two techniques, the following takes a movie of what's on the screen:
aegis-exec -a "GRP::video" -a "GRP::pulse-access" gst-launch-0.10 -v ximagesrc ! ffmpegcolorspace ! jpegenc ! multipartmux ! filesink location=screenlapse.mjpeg
However the resulting file can't be uploaded to YouTube since they don't recognize .mjpeg movies.
Fortunately, a standard movie file format can be created from the .mjpeg file by running the following command-line (on Linux desktop):
mencoder screenlapse.mjpeg -fps 25 -ofps 3 -o screenlapse.avi -vf scale=1280:720 -ovc lavc -lavcopts vcodec=mjpeg -oac copy
Summary
http://www.youtube.com/watch?v=oEYMsrA_8gY is an example screen capture directly from Nokia N950 using the above scripts.
For further reference on the commands used above, see
- http://wiki.oz9aec.net/index.php/Gstreamer_cheat_sheet
- http://electron.mit.edu/~gsteele/ffmpeg/
- http://web.njit.edu/all_topics/Prog_Lang_Docs/html/mplayer/encoding.html
- http://maemo.org/maemo_release_documentation/maemo4.1.x/node9.html
TODO: any suggestions on extra elements to add into the gstreamer pipeline to allow capture of system sounds in synch with the movie? Also, any suggestions on getting a more accurate framerate so that the resulting movie plays back in "real time?"


NielsMayer - parallel thread on MeeGo Handset forum
http://forum.meego.com/showthread.php?t=4833NielsMayer 01:13, 2 November 2011 (EET)
NielsMayer - Related discussion from IRC #harmattan
.........
.............
Merlin1991 - package name and repository for gst-launch
I came back to this today and tried to use it on the n9 (pr 1.1) which didn't work out due to missing gst-launch
The package that contains gst-launch is gstreamer0.10-tools but even with dev-mode enabled it is not provided by any repository.
Manually adding harmattan sdk repo to the device fixes that problem.
As root:
apt-get install gstreamer0.10-toolsecho 'deb http://harmattan-dev.nokia.com/ harmattan/sdk free non-free' > /etc/apt/sources.list.d/sdk.list
apt-get update
merlin1991 04:53, 17 December 2011 (EET)