I am trying to build an application more or less like Cheese (http://projects.gnome.org/cheese/). However I would like to switch from just showing the webcam to a recording state "smoothly" when the user press the record button.

So far I have tried the following approaches without succes:
  1. Changing location property of filesink while playing (from /dev/null to a real path). This is not possible (filesink tells me so).
  2. Open 2 different pipelines both of them pointing to the same v4l2src (no success since only one pipeline can access the webcam at once).
Since these approaches were not working I tried to set the pipeline to STATE_NULL, change the location of the filesink, and then set the pipeline to STATE_PLAYING again. However, when setting the pipeline to STATE_NULL, no STATE_CHANGE event is thrown. Is this the expected behavior ?

Any ideas ? Can the smooth "play-to-record" be accomplished with GStreamer ?

Thank you
PD. For the record: I am programming in Python and the pipeline I am trying to manage is the following:

gst-launch-0.10 v4l2src ! tee name=videoout ! queue ! videorate ! video/x-raw-yuv,fps=15 ! queue ! theoraenc quality=60 ! queue ! muxout. pulsesrc ! audio/x-raw-int,rate=22000,channels=1,width=16 ! queue ! audioconvert ! vorbisenc ! queue ! muxout. oggmux name=muxout ! filesink location=test.ogg videoout. ! queue ! ffmpegcolorspace ! ximagesink

Marc S.