Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Capture movie directly from N9/N950 screen

From Wiki
Jump to: navigation, search

This article explains how to capture a movie directly from N9/N950 screen without a video camera

Article Metadata
Tested with
Devices(s): Nokia N9, Nokia N950
Platform(s): Harmattan, MeeGo, Linux
Created: NielsMayer (01 Nov 2011)
Last edited: hamishwillee (13 Jun 2012)


Putting together a video for the first release of 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 is an example screen capture directly from Nokia N950 using the above scripts.

For further reference on the commands used above, see

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?"

This page was last modified on 13 June 2012, at 10:51.
55 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.