<div dir="ltr"><div class=""><p>Now It works!. The solution was to add "format" to capsfilter. Previous caps filter string was:</p>

<pre style class=""><code><span class="">caps </span><span class="">=</span><span class=""> gst</span><span class="">.</span><span class="">Caps</span><span class="">(</span><span class="">'video/x-raw-yuv,width=640,height=480,framerate=30/1'</span><span class="">)</span></code></pre>



<p>and now it is:</p>

<pre style class=""><code><span class="">caps </span><span class="">=</span><span class=""> gst</span><span class="">.</span><span class="">Caps</span><span class="">(</span><span class="">'video/x-raw-yuv,format=(fourcc)I420,width=640,height=480,framerate=30/1'</span><span class="">)</span></code></pre>



<p>The problem was that my webcam default output pixel format was "YUYV"
 and the theoraenc element in my fileSink Bin not accepted this format, 
so adding <code>format=(fourcc)I420</code> helped.
Still I don't know why the previous capsfilter string worked with gst-launch but I don't mind now.
Thanks for help</p>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/9/2 Piotr Szychowski <span dir="ltr"><<a href="mailto:zikann@gmail.com" target="_blank">zikann@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr">This works:<br><pre><code><span>gst</span><span>-</span><span>launch </span><span>-</span><span>e v4l2src </span><span>!</span><span> video</span><span>/</span><span>x</span><span>-</span><span>raw</span><span>-</span><span>yuv</span><span>,</span><span>width</span><span>=</span><span>640</span><span>,</span><span>height</span><span>=</span><span>480</span><span>,</span><span>framerate</span><span>=</span><span>30</span><span>/</span><span>1</span><span> </span><span>!</span><span> tee name</span><span>=</span><span>splitter </span><span>!</span><span> queue </span><span>!</span><span> autovideosink splitter</span><span>.</span><span> </span><span>!</span><span> queue </span><span>!</span><span> theoraenc </span><span>!</span><span> oggmux </span><span>!</span><span> filesink location</span><span>=</span><span>testogg</span><span>.</span><span>ogg<br>


<br></span></code></pre><pre>I'm trying to do the same in a dynamic way using python and pygst, the 
autovideosink branch is always there and after user input I want to 
attach the filesink.<br><br><code><span>    fileSink </span><span>=</span><span> self</span><span>.</span><span>getFileSink</span><span>()    #creates the filesink Bin</span><span>
    pad </span><span>=</span><span> fileSink</span><span>.</span><span>get_static_pad</span><span>(</span><span>'sink'</span><span>)</span><span>
    pad</span><span>.</span><span>set_blocked_async</span><span>(</span><span>True</span><span>,</span><span> self</span><span>.</span><span>padBlockedOnRecordStart</span><span>,</span><span> </span><span>None</span><span>)</span><span>
    self</span><span>.</span><span>player</span><span>.</span><span>add</span><span>(</span><span>fileSink</span><span>)</span><span>
    fileSink</span><span>.</span><span>set_state</span><span>(</span><span>gst</span><span>.</span><span>STATE_PLAYING</span><span>)</span><span>
    self</span><span>.</span><span>player</span><span>.</span><span>get_by_name</span><span>(</span><span>'splitter'</span><span>).</span><span>link</span><span>(</span><span>fileSink</span><span>)</span><span>
    pad</span><span>.</span><span>set_blocked_async</span><span>(</span><span>False</span><span>,</span><span> self</span><span>.</span><span>padBlockedOnRecordStart</span><span>,</span><span> </span><span>None</span><span>)</span></code><br>


<br>on linking the splitter(tee) to the fileSink Bin I get this error:<br><br><code><span>Error</span><span>:</span><span> </span><span>GStreamer</span><span> encountered a general stream error</span><span>.</span><span> gstbasesrc</span><span>.</span><span>c</span><span>(</span><span>2625</span><span>):</span><span> gst_base_src_loop </span><span>():</span><span> </span><span>/</span><span>GstPipeline</span><span>:</span><span>player</span><span>/</span><span>GstV4l2Src</span><span>:</span><span>video</span><span>:</span><span>
streaming task paused</span><span>,</span><span> reason </span><span>not</span><span>-</span><span>negotiated </span><span>(-</span><span>4</span><span>)</span><span> </span></code><br>
<br></pre><pre>Any help would be appreciated.<br><br></pre><pre>Regards<span class="HOEnZb"><font color="#888888"><br></font></span></pre><span class="HOEnZb"><font color="#888888"><pre>Piotr Szychowski <br></pre></font></span></div>


</blockquote></div><br></div>