GNOME Bugzilla – Bug 724856
mpegpsdemux for python unnormal
Last modified: 2014-02-21 08:03:32 UTC
Hi all: Recently I use gstreamer to develop a program.I wanna exchanging H.264 ps stream to es stream.When I use below pipeline ,it works well: gst-launch-0.10 filesrc location=test.264 ! typefind ! mpegpsdemux ! filesink location=es.264 But ,When I change this way to use a python program,the es.264(filesink) is 0. My program is : import gi gi.require_version('Gst', '1.0') from gi.repository import GObject, Gst import os,sys,threading #from ctypes import * GObject.threads_init() Gst.init(None) pipeline = Gst.Pipeline() filesrc = Gst.ElementFactory.make('filesrc','filesrc') filesrc.set_property('location', 'E:\\test.264') pipeline.add(filesrc) typefind = Gst.ElementFactory.make('typefind','typefind') pipeline.add(typefind) mpegpsdemux = Gst.ElementFactory.make('mpegpsdemux','mpegpsdemux') pipeline.add(mpegpsdemux) filesink = Gst.ElementFactory.make('filesink','filesink') filesink.set_property('location', 'E:\\es.264') pipeline.add(filesink) filesrc.link(typefind) typefind.link(mpegpsdemux) mpegpsdemux.link(filesink) #typefind.link(filesink) pipeline.set_state(Gst.State.PLAYING) print "start..." GObject.MainLoop().run() what is the problem????
This is not a bug, but expected behaviour. The link() between mpegpsdemux and filesink will fail, because the demuxer doesn't have any source pads yet before dataflow starts. use the pad-added signal to wait for a pad on the demuxer, or build the pipeline using Gst.parse_launch(), which will handle that automatically for you. Please use the gstreamer-devel mailing list for any further support questions, thanks.