diff options
author | Daniel Drake <dsd@laptop.org> | 2010-04-29 13:51:47 (GMT) |
---|---|---|
committer | Daniel Drake <dan@reactivated.net> | 2010-04-29 14:52:03 (GMT) |
commit | 157adbc0cac15e60676d1733c49dfa163f8f8838 (patch) | |
tree | 57d646adb685dbe1d774c9aea3301df62a1951c6 | |
parent | cf7fb15d94b335402e4ddd4cfad2e9e80c517ddd (diff) |
Stop pipeline while initiating video capture
This is needed for good A/V sync (gstreamer bug?)
-rw-r--r-- | glive.py | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -406,14 +406,16 @@ class Glive: OGG_TRAITS[quality]['width'], OGG_TRAITS[quality]['height']) - pad = self.videobin.get_static_pad("sink") - pad.set_blocked_async(True, self.blockedCb, None) + # If we use pad blocking and adjust the pipeline on-the-fly, the + # resultant video has bad A/V sync :( + # If we pause the pipeline while adjusting it, the A/V sync is better + # but not perfect :( + # so we stop the whole thing while reconfiguring to get the best results + self.pipeline.set_state(gst.STATE_NULL) self.pipeline.add(self.videobin) - self.videobin.set_state(gst.STATE_PLAYING) self.pipeline.get_by_name("tee").link(self.videobin) - pad.set_blocked_async(False, self.blockedCb, None) self.pipeline.add(self.audiobin) - self.audiobin.set_state(gst.STATE_PLAYING) + self.pipeline.set_state(gst.STATE_PLAYING) def startRecordingAudio(self): self.audioPixbuf = None |