Hi,<br><br><div class="gmail_quote">On Thu, Apr 29, 2010 at 10:25 PM, Dr. Peter G. Baum <span dir="ltr"><<a href="mailto:peter@dr-baum.net" target="_blank">peter@dr-baum.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br>
<br>
I want to play video and audio from dvbbasebin with the help of decodebin.<br>
When I construct the pipeline for the first time it works perfectly, but<br>
when I disconnect decodebin from dvbbasebin and then reconnect, the<br>
audio is sometimes OK and sometimes jerky, the video is always jerky.<br></blockquote><div><br>sorry, it's not clear to me whether you're reusing the same pipeline or not.<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
The details follow below.<br>
<br>
Many thanks for the help,<br>
<br>
Peter<br>
<br>
<br>
My pipeline looks if I'm connected like this:<br>
dvbbasebin0 (PLAYING):<br>
-> program_16418<br>
queue7 (PLAYING):<br>
-> src<br>
tee4 (PLAYING):<br>
-> src0<br>
fakesink5 (PLAYING):<br>
-> program_16407<br>
queue6 (PLAYING):<br>
-> src<br>
tee3 (PLAYING):<br>
-> src0<br>
fakesink4 (PLAYING):<br>
-> program_16406<br>
queue5 (PLAYING):<br>
-> src<br>
tee2 (PLAYING):<br>
-> src0<br>
fakesink3 (PLAYING):<br>
-> program_16405<br>
queue4 (PLAYING):<br>
-> src<br>
tee1 (PLAYING):<br>
-> src1<br>
decodebin0 (PLAYING):<br>
-> src1<br>
audioSink (PLAYING):<br>
-> src0<br>
videoSink (PLAYING):<br>
-> src0<br>
fakesink2 (PLAYING):<br>
-> program_0<br>
queue3 (PLAYING):<br>
-> src<br>
tee0 (PLAYING):<br>
-> src0<br>
fakesink1 (PLAYING):<br></blockquote><div><br>looks like you have many sources connected to a tee, only one branch of the latter is connected to a sink which is a fakesink. Either you can simplify the pipeline or it's not completely reported here.<br>
<br>Can you generate a dotfile out of it?<br><br>You can do ti by calling GST_DEBUG_BIN_TO_DOT_FILE_<div id=":7g" class="ii gt">WITH_TS(bin, details, file_name).
Run
your app using GST_DEBUG_DUMP_DOT_DIR=$PWD, convert the generated dot
file to svg or png and look at it / attach it here.</div> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
<br>
Video and audio sinks are bins:<br>
# make bin for audio sink<br>
self._audioSink = gst.Bin( "audioSink" )<br>
# not quite sure whether queue is necessary<br>
queue = gst.element_factory_make( "queue" )<br>
queue.set_property( "max-size-buffers", 0 )<br>
queue.set_property( "max-size-time", 0 )<br></blockquote><div><br>What if you do not set the max-size properties?<br><br>Regards<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
sink = gst.element_factory_make( "pulsesink" )<br>
self._audioSink.add( queue, sink )<br>
gst.element_link_many( queue, sink )<br>
ghostpad = gst.GhostPad( "sink", queue.get_pad( 'sink' ) )<br>
self._audioSink.add_pad( ghostpad )<br>
<br>
# make bin for video sink<br>
self._videoSink = gst.Bin( "videoSink" )<br>
# not quite sure whether queue is necessary<br>
queue = gst.element_factory_make( "queue" )<br>
queue.set_property( "max-size-buffers", 0 )<br>
queue.set_property( "max-size-time", 0 )<br>
color = gst.element_factory_make( "ffmpegcolorspace" )<br>
# this takes a lot of CPU, but improves quality tremendously<br>
deinterlace = gst.element_factory_make( "deinterlace" )<br>
sink = gst.element_factory_make( "xvimagesink" )<br>
self._videoSink.add( queue, color, deinterlace, sink )<br>
gst.element_link_many( queue, color, deinterlace, sink )<br>
ghostpad = gst.GhostPad( "sink", queue.get_pad( 'sink' ) )<br>
self._videoSink.add_pad( ghostpad )<br>
<br>
<br>
To disconnect I do:<br>
teePad = chanInf.pad<br>
peer = teePad.get_peer()<br>
teePad.set_blocked( True )<br>
teePad.unlink( peer )<br>
teePad.set_blocked( False )<br>
tee = teePad.get_parent_element( )<br>
tee.release_request_pad( teePad )<br>
<br>
self._decodebin.unlink( self._audioSink )<br>
self._decodebin.unlink( self._videoSink )<br>
self._decodebin.set_state( gst.STATE_READY )<br>
self._audioSink.set_state( gst.STATE_READY )<br>
self._videoSink.set_state( gst.STATE_READY )<br>
<br>
<br>
To reconnect I do:<br>
def __onProgPadAdded( self, id, pad, new ):<br>
pad.link( self._decodebin.get_pad( 'sink' ) )<br>
self._decodebin.set_state( gst.STATE_PLAYING )<br>
<br>
And:<br>
def __onMuxPadAdded( self, obj, pad ):<br>
if pad.can_link( self._audioSink.get_pad( 'sink' ) ):<br>
print "linking audio"<br>
pad.link( self._audioSink.get_pad( 'sink' ) )<br>
self._audioSink.set_state( gst.STATE_PLAYING )<br>
elif pad.can_link( self._videoSink.get_pad( 'sink' ) ):<br>
print "linking video"<br>
pad.link( self._videoSink.get_pad( 'sink' ) )<br>
self._videoSink.set_state( gst.STATE_PLAYING )<br>
<br>
<br>
------------------------------------------------------------------------------<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.sourceforge.net" target="_blank">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>