Hi all,
I'm trying to import still images into the timeline, giving them a
default duration of 5 seconds (this is hardcoded now, just for testing).
The attached patch allows me to drag the images into the timeline, but
both playing or rendering the resulting video does not work: I don't get
any error while playing, and when rendering I get these messages in the
console:
=============
(pitivi:7007): GStreamer-CRITICAL **: gst_mini_object_ref: assertion
`GST_IS_MINI_OBJECT (mini_object)' failed
(pitivi:7007): GStreamer-CRITICAL **: gst_pad_push: assertion
`GST_IS_BUFFER (buffer)' failed
=============
and a dialog pops up with this error message (Internal data flow error):
=============
gstbasesrc.c(1816): gst_base_src_loop (): /project-New
Project/timeline-New
Project/composition-videocomp/source-file:///home/mardy/08012007020.jpg-video1/imagebin/pitivi+elements+singledecodebin+singledecodebin0/urisrc:
streaming task paused, reason error (-5)
=============
I'm a bit stuck, can please someone have a look at the attached patch?
(I'm no gst expert, I might be doing something stupid)
Ciao,
Alberto
Index: discoverer.py
===================================================================
--- discoverer.py (revision 1074)
+++ discoverer.py (working copy)
@@ -154,9 +154,13 @@
elif self.currentfactory:
self.currentfactory.addMediaTags(self.currentTags)
if not self.currentfactory.length:
- self.emit('not_media_file', self.current,
- _("Could not establish the duration of the file."),
- _("This clip seems to be in a format which cannot be accessed in a random fashion."))
+# self.emit('not_media_file', self.current,
+# _("Could not establish the duration of the file."),
+# _("This clip seems to be in a format which cannot be accessed in a random fashion."))
+ self.currentfactory.length = 5000000000
+ self.currentfactory.set_property("length", 5000000000)
+ self.currentfactory.is_image = 1
+ self.emit('finished-analyzing', self.currentfactory)
else:
self.emit('finished-analyzing', self.currentfactory)
self.currentTags = []
Index: timeline/source.py
===================================================================
--- timeline/source.py (revision 1074)
+++ timeline/source.py (working copy)
@@ -112,6 +112,13 @@
self.decodebin.connect('pad-added', self._decodebinPadAddedCb)
self.decodebin.connect('pad-removed', self._decodebinPadRemovedCb)
gnlobject.add(self.volumeBin)
+ elif hasattr(self.factory, 'is_image'):
+ self.freezeElement = gst.element_factory_make("freeze", "img2vid")
+ self.imageBin = gst.Bin("imagebin")
+ self.imageBin.add(self.decodebin, self.freezeElement)
+ self.decodebin.connect('pad-added', self._decodebinPadAddedCb2)
+ self.decodebin.connect('pad-removed', self._decodebinPadRemovedCb2)
+ gnlobject.add(self.imageBin)
else:
gnlobject.add(self.decodebin)
gnlobject.set_property("caps", caps)
@@ -129,6 +136,23 @@
return gnlobject
+ def _decodebinPadAddedCb2(self, dbin, pad):
+ pad.link(self.freezeElement.get_pad("sink"))
+ ghost = gst.GhostPad("src", self.freezeElement.get_pad("src"))
+ ghost.set_active(True)
+ self.imageBin.add_pad(ghost)
+
+ def _decodebinPadRemovedCb2(self, dbin, pad):
+ gst.log("pad:%s" % pad)
+ # workaround for gstreamer bug ...
+ gpad = self.imageBin.get_pad("src")
+ target = gpad.get_target()
+ peer = target.get_peer()
+ target.unlink(peer)
+ # ... to hereeeto here
+ self.imageBin.remove_pad(self.imageBin.get_pad("src"))
+ self.decodebin.unlink(self.freezeElement)
+
def _decodebinPadAddedCb(self, dbin, pad):
pad.link(self.audioconv.get_pad("sink"))
ghost = gst.GhostPad("src", self.volumeElement.get_pad("src"))
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Pitivi-pitivi mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pitivi-pitivi