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. Thanks for all your past and future contributions.

Archived:How to record video with PySymbian

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

The article is believed to be still valid for the original topic scope.

This snippet shows how to record video in Python.

Article Metadata
Tested with
Devices(s): Nokia N95, Nokia E90
CompatibilityPlatform Security
Capabilities: )
Keywords: camera
Created: bogdan.galiceanu (21 Mar 2008)
Last edited: hamishwillee (14 Jun 2013)


Note: The camera module is not available for S60 1st Edition.

Valid file formats must be used. Their availability may vary from one device generation to another and they tipically include 3GP, MP4.

Source code

import appuifw, e32, camera
app_lock = e32.Ao_lock()
#Define the exit function
def quit():
#Cancel the timer when the user exits, if it has not expired
#Close the viewfinder
#Release the camera so that other programs can use it
app_lock.signal() = quit
#Function for displaying the viewfinder
def vf(im):
def video_callback(err, current_state):
global control_light
if current_state == camera.EPrepareComplete:
video_savepath = u"C:\\vid.mp4"
#This is the path and name of the video to be recorded = appuifw.Canvas()
#Start the viewfinder
#Start recording
vid = camera.start_record(video_savepath, video_callback)
#Instantiate a timer
t = e32.Ao_timer()
#Record for 10 seconds, then stop
t.after(10, lambda:camera.stop_record())
#Wait for the user to request the exit


The viewfinder will be displayed on the device's screen and a video clip will be recorded to the specified path for the specified duration (note that due to hardware capabilities and processes executed, the actual duration of the recorded clip may vary). Recording will automatically stop after that duration and the script will wait for the user to exit.

This page was last modified on 14 June 2013, at 05:10.
62 page views in the last 30 days.