Thank you very much Arnout. <br><br>Using the method you described I am able to record from the webcam every time the user presses a button. As you pointed, also, I am having trouble with timestamps. In my case, since I just need to record one file at time, I would be ok to reset the base time for the v4l2src element. However ,when I try to set the base_time to 0 for this element it stops streaming new images.<br>
<br>Since I&#39;d like to stick to the &quot;default&quot; gstreamer packages, is there a way to set the base_time for v4l2src without it being stopped ?<br><br>Thanks<br><br><div class="gmail_quote">2009/1/31 Arnout Vandecappelle <span dir="ltr">&lt;<a href="mailto:arnout@mind.be">arnout@mind.be</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c">On Friday 30 January 2009 20:37:49 Marc wrote:<br>
&gt; I am trying to build an application more or less like Cheese<br>
&gt; (<a href="http://projects.gnome.org/cheese/" target="_blank">http://projects.gnome.org/cheese/</a>). However I would like to switch from<br>
&gt; just showing the webcam to a recording state &quot;smoothly&quot; when the user press<br>
&gt; the record button.<br>
&gt;<br>
&gt; So far I have tried the following approaches without succes:<br>
&gt; Changing location property of filesink while playing (from /dev/null to a<br>
&gt; real path). This is not possible (filesink tells me so). Open 2 different<br>
&gt; pipelines both of them pointing to the same v4l2src (no success since only<br>
&gt; one pipeline can access the webcam at once). Since these approaches were<br>
&gt; not working I tried to set the pipeline to STATE_NULL, change the location<br>
&gt; of the filesink, and then set the pipeline to STATE_PLAYING again. However,<br>
&gt; when setting the pipeline to STATE_NULL, no STATE_CHANGE event is thrown.<br>
&gt; Is this the expected behavior ?<br>
&gt;<br>
&gt; Any ideas ? Can the smooth &quot;play-to-record&quot; be accomplished with GStreamer<br>
&gt; ?<br>
&gt;<br>
&gt; Thank you<br>
&gt; PD. For the record: I am programming in Python and the pipeline I am trying<br>
&gt; to manage is the following:<br>
&gt;<br>
&gt; &nbsp;gst-launch-0.10 v4l2src ! tee name=videoout ! queue ! videorate !<br>
&gt; video/x-raw-yuv,fps=15 ! queue ! theoraenc quality=60 ! queue ! muxout.<br>
&gt; pulsesrc ! audio/x-raw-int,rate=22000,channels=1,width=16 ! queue !<br>
&gt; audioconvert ! vorbisenc ! queue ! muxout. oggmux name=muxout ! filesink<br>
&gt; location=test.ogg videoout. ! queue ! ffmpegcolorspace ! ximagesink<br>
<br>
</div></div>&nbsp;You can add the videoout tail of the pipeline dynamically. &nbsp;Start without it,<br>
and when the user presses the record button, add it to the pipeline and link<br>
it (and set each element to PLAYING individually). &nbsp;It&#39;s not even necessary<br>
to pause the pipeline.<br>
<br>
&nbsp;It&#39;s more difficult to smoothly stop the recording, though. &nbsp;You&#39;ll have to<br>
block the queue element behind the tee (see docs/design/part-block.txt in the<br>
source tree). &nbsp;In addition, you have to push an EOS into it to make sure the<br>
muxer writes duration and index to the file.<br>
<br>
&nbsp;A last caveat is the timestamps. &nbsp;The buffer timestamps start running as soon<br>
as the v4l2src starts playing, which makes it appear in the output file as if<br>
it starts with a big hole. &nbsp;The only way I found to fix that is to add an<br>
adapter element that shifts the buffer timestamps (see<br>
<a href="http://bugzilla.gnome.org/show_bug.cgi?id=561224" target="_blank">http://bugzilla.gnome.org/show_bug.cgi?id=561224</a> ).<br>
<br>
&nbsp;Regard,<br>
&nbsp;Arnout<br>
--<br>
Arnout Vandecappelle &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; arnout at mind be<br>
Senior Embedded Software Architect &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; +32-16-286540<br>
Essensium/Mind &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.mind.be" target="_blank">http://www.mind.be</a><br>
G.Geenslaan 9, 3001 Leuven, Belgium &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;BE 872 984 063 RPR Leuven<br>
LinkedIn profile: <a href="http://www.linkedin.com/in/arnoutvandecappelle" target="_blank">http://www.linkedin.com/in/arnoutvandecappelle</a><br>
GPG fingerprint: &nbsp;D206 D44B 5155 DF98 550D &nbsp;3F2A 2213 88AA A1C7 C933<br>
<br>
------------------------------------------------------------------------------<br>
This SF.net email is sponsored by:<br>
SourcForge Community<br>
SourceForge wants to tell your story.<br>
<a href="http://p.sf.net/sfu/sf-spreadtheword" target="_blank">http://p.sf.net/sfu/sf-spreadtheword</a><br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Marc S.<br>