<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 26.12.18 14:58, Bernhard Graaf
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:62E4DB3E12204B4D8FFE935C8282178D@BernhardPC">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Generator" content="Microsoft Word 11 (filtered
medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";
color:black;}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
p
{mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman";
color:black;}
span.E-MailFormatvorlage18
{mso-style-type:personal-reply;
font-family:Arial;
color:navy;}
@page Section1
{size:595.3pt 841.9pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.Section1
{page:Section1;}
-->
</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="Section1">
<p class="MsoNormal"><font size="2" face="Arial" color="navy"><span
style="font-size:
10.0pt;font-family:Arial;color:navy">Hi,<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Arial" color="navy"><span
style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Arial" color="navy"><span
style="font-size:10.0pt;font-family:Arial;color:navy"
lang="EN-GB">You use the wrong
audiosink:<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Arial" color="navy"><span
style="font-size:10.0pt;font-family:Arial;color:navy"
lang="EN-GB">audio_sink =
Gst.ElementFactory.make('autovideosink', 'audio_sink') </span></font><font
size="2" face="Wingdings" color="navy"><span
style="font-size:10.0pt;
font-family:Wingdings;color:navy"
lang="EN-GB">à</span></font><font size="2" face="Arial"
color="navy"><span
style="font-size:10.0pt;font-family:Arial;
color:navy"
lang="EN-GB"> autoaudiosink?<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Arial" color="navy"><span
style="font-size:10.0pt;font-family:Arial;color:navy"
lang="EN-GB"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Arial" color="navy"><span
style="font-size:10.0pt;font-family:Arial;color:navy"
lang="EN-GB">Bernhard<o:p></o:p></span></font></p>
</div>
</blockquote>
<p>Obs... How stupid is that - yes you are right! That was the
problem. Maybe I copy that line and forgot to change the sink...</p>
<p>Thank you for pointing this out!<br>
</p>
<p>Jonathan<br>
</p>
<p><br>
</p>
<blockquote type="cite"
cite="mid:62E4DB3E12204B4D8FFE935C8282178D@BernhardPC">
<div class="Section1">
<p class="MsoNormal"><font size="2" face="Arial" color="navy"><span
style="font-size:10.0pt;font-family:Arial;color:navy"
lang="EN-GB"><o:p> </o:p></span></font></p>
<div>
<div class="MsoNormal" style="text-align:center"
align="center"><font size="3" face="Times New Roman"
color="black"><span
style="font-size:12.0pt;color:windowtext">
<hr tabindex="-1" width="100%" size="2" align="center">
</span></font></div>
<p class="MsoNormal"><b><font size="2" face="Tahoma"
color="black"><span
style="font-size:10.0pt;font-family:Tahoma;color:windowtext;font-weight:bold">Von:</span></font></b><font
size="2" face="Tahoma" color="black"><span
style="font-size:10.0pt;font-family:Tahoma;
color:windowtext">
gstreamer-devel
[<a class="moz-txt-link-freetext" href="mailto:gstreamer-devel-bounces@lists.freedesktop.org">mailto:gstreamer-devel-bounces@lists.freedesktop.org</a>] <b><span
style="font-weight:bold">Im Auftrag von </span></b>Jonathan
Baecker<br>
<b><span style="font-weight:bold">Gesendet:</span></b>
Mittwoch, 26. Dezember
2018 13:22<br>
<b><span style="font-weight:bold">An:</span></b>
<a class="moz-txt-link-abbreviated" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<b><span style="font-weight:bold">Betreff:</span></b>
GStreamer (1.14) Pipeline
in Python3</span></font><font color="black"><span
style="color:windowtext"><o:p></o:p></span></font></p>
</div>
<p class="MsoNormal"><font size="3" face="Times New Roman"
color="black"><span style="font-size:12.0pt"><o:p> </o:p></span></font></p>
<p><font size="3" face="Times New Roman" color="black"><span
style="font-size:12.0pt">Hello,<o:p></o:p></span></font></p>
<p><font size="3" face="Times New Roman" color="black"><span
style="font-size:12.0pt">I
try to understand the way Python and gstreamer works
together. I'm able to
build a pipeline for only video and that plays just fine,
but when I add audio
my pipeline stops by the first frame and put this to
screen.<o:p></o:p></span></font></p>
<p><font size="3" face="Times New Roman" color="black"><span
style="font-size:12.0pt">Can
you tell me, what is wrong with my code here?:<o:p></o:p></span></font></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p><font size="2" face="Times New Roman" color="black"><span
style="font-size:10.0pt">#!/usr/bin/env
python3<br>
<br>
import gi<br>
gi.require_version('Gst', '1.0')<br>
gi.require_version('GLib', '2.0')<br>
from gi.repository import GLib, Gst<br>
<br>
# mode debugging infos<br>
Gst.debug_set_active(True)<br>
Gst.debug_set_default_threshold(3)<br>
<br>
<br>
# callback link pads<br>
def on_new_decoded_pad(dbin, pad):<br>
type = pad.query_caps(None).to_string()<br>
decode = pad.get_parent()<br>
pipeline = decode.get_parent()<br>
<br>
if type.startswith("video"):<br>
video_queue =
pipeline.get_by_name("video_queue")<br>
decode.link(video_queue)<br>
print("linked video")<br>
if type.startswith("audio"):<br>
audio_queue =
pipeline.get_by_name("audio_queue")<br>
decode.link(audio_queue)<br>
print("linked audio")<br>
<br>
<br>
def main():<br>
Gst.init(None)<br>
<br>
# create new pipeline<br>
pipe = Gst.Pipeline.new('pipleline')<br>
<br>
# add source and decoder<br>
src = Gst.ElementFactory.make('filesrc', "src")<br>
decode = Gst.ElementFactory.make('decodebin',
'decode')<br>
<br>
# video queue and sink<br>
video_queue = Gst.ElementFactory.make('queue',
'video_queue')<br>
video_sink =
Gst.ElementFactory.make('autovideosink',
'video_sink')<br>
<br>
# audio queue and sink<br>
audio_queue = Gst.ElementFactory.make('queue',
'audio_queue')<br>
audio_convert =
Gst.ElementFactory.make('audioconvert',
'audio_convert')<br>
audio_sink =
Gst.ElementFactory.make('autovideosink',
'audio_sink')<br>
<br>
# set some properties<br>
src.set_property('location', 'test.mp4')<br>
video_sink.set_property('sync', 'true')<br>
audio_sink.set_property('sync', 'true')<br>
<br>
# create pipeline<br>
pipe.add(src)<br>
pipe.add(decode)<br>
pipe.add(video_queue)<br>
pipe.add(video_sink)<br>
pipe.add(audio_queue)<br>
pipe.add(audio_convert)<br>
pipe.add(audio_sink)<br>
<br>
# link elements<br>
src.link(decode)<br>
video_queue.link(video_sink)<br>
audio_queue.link(audio_convert)<br>
audio_convert.link(audio_sink)<br>
<br>
# link decoder to coresponding queue<br>
decode.connect('pad-added', on_new_decoded_pad)<br>
<br>
loop = GLib.MainLoop()<br>
<br>
# start pipeline in play mode<br>
pipe.set_state(Gst.State.PLAYING)<br>
loop.run()<br>
<br>
# cleanup<br>
pipe.set_state(Gst.State.NULL)<br>
<br>
<br>
if __name__ == '__main__':<br>
main()</span></font><o:p></o:p></p>
</blockquote>
<p><font size="3" face="Times New Roman" color="black"><span
style="font-size:12.0pt"><o:p> </o:p></span></font></p>
<p><font size="3" face="Times New Roman" color="black"><span
style="font-size:12.0pt">I
hope it is ok, to post so much code here, when not I can
post next time a gist
link.<o:p></o:p></span></font></p>
<p><font size="3" face="Times New Roman" color="black"><span
style="font-size:12.0pt"><o:p> </o:p></span></font></p>
<p><font size="3" face="Times New Roman" color="black"><span
style="font-size:12.0pt">Regards<o:p></o:p></span></font></p>
<p><font size="3" face="Times New Roman" color="black"><span
style="font-size:12.0pt">Jonathan<o:p></o:p></span></font></p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
gstreamer-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
</pre>
</blockquote>
<p><br>
</p>
</body>
</html>