Hi, gstreamer-devel:<br><br> Thanks, Arnout! I got it.<br><br>Eric Zhang<br><br><div class="gmail_quote">2008/11/10 Arnout Vandecappelle <span dir="ltr"><<a href="mailto:arnout@mind.be">arnout@mind.be</a>></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 class="Ih2E3d">On Monday 10 November 2008 03:58:18 Eric Zhang wrote:<br>
> So could you explain a little bit why we should add this extra<br>
> capsfilter to make decodebin works? Thanks a lot.<br>
<br>
</div> If you think a bit about it, it's easy enough to understand. gst-launch is<br>
completely agnostic about what all the pipeline elements do, but it somehow<br>
has to choose which sink pad to connect to which source pad of the rtspsrc.<br>
Look at the gst-launch command:<br>
<div class="Ih2E3d"><br>
gst-launch rtspsrc location="rtsp://xxxxxx" name=d<br>
d. ! decodebin ! ffmpegcolorspace ! xvimagesink<br>
d. ! decodebin ! audioconvert ! alsasink<br>
<br>
</div>When rtspsrc creates a video source pad, gst-launch has to choose which of the<br>
two decodebins to connect to it. Since they look identical (gst-launch can't<br>
look into the rest of the pipeline, who knows what decodebin will do<br>
anyway?), gst-launch randomly connect the video source to one of the<br>
decodebins. After prerolling, the decodebin creates a source pad for the<br>
video and gst-launch has to connect it to the next element. Now, if you're<br>
lucky, gst-launch had select the first decodebin and all goes well. If<br>
you're unlucky, however, it has chosen the second decodebin, and gst-launch<br>
connects the audioconvert to the decodebin's video source pad... That<br>
doesn't work, so the linking fails.<br>
<br>
That doesn't crash your application yet. It's only when the pipeline goes<br>
into PLAYING and the source starts pushing data in the decodebin, that it<br>
turns out that the decodebin doesn't have anywhere to send the data to.<br>
That's what triggers the 'Not linked' error.<br>
<br>
<br>
When you use the depayloader and decoder explicitly instead of decodebin, the<br>
linking works correctly:<br>
<div class="Ih2E3d"><br>
gst-launch rtspsrc location="rtsp://xxxxxx" name=d<br>
d. ! rtph263pdepay ! ffdec_h263 ! ffmpegcolorspace ! xvimagesink<br>
d. ! rtpamrdepay ! amrnbdec ! audioconvert ! alsasink<br>
<br>
</div>Now, the two branches of the pipeline are no longer identical. gst-launch<br>
looks at the caps of rtph263pdepay and rtpamrdepay to see which one matches<br>
the video source. It will therefore always select the right one. You get<br>
the same behaviour with a decodebin by providing caps explicitly.<br>
<br>
<br>
Regards,<br>
Arnout<br>
<font color="#888888"><br>
--<br>
Arnout Vandecappelle arnout at mind be<br>
Senior Embedded Software Architect +32-16-286540<br>
Essensium/Mind <a href="http://www.mind.be" target="_blank">http://www.mind.be</a><br>
G.Geenslaan 9, 3001 Leuven, Belgium 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: D206 D44B 5155 DF98 550D 3F2A 2213 88AA A1C7 C933<br>
</font><div><div></div><div class="Wj3C7c"><br>
-------------------------------------------------------------------------<br>
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge<br>
Build the coolest Linux based applications with Moblin SDK & win great prizes<br>
Grand prize is a trip for two to an Open Source event anywhere in the world<br>
<a href="http://moblin-contest.org/redirect.php?banner_id=100&url=/" target="_blank">http://moblin-contest.org/redirect.php?banner_id=100&url=/</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>
</div></div></blockquote></div><br>