Re: Syncing Audio w/ Video problems

26 views
Skip to first unread message

Blaine Booher

unread,
Nov 5, 2012, 8:26:51 AM11/5/12
to pyglet...@googlegroups.com
I'm just curious: Has anyone else synced audio and video without problems in pyglet?

On Friday, November 2, 2012 5:18:04 PM UTC-4, Blaine Booher wrote:
Hi guys. I'm using cocos2d's director for displaying 2D scenes. It's just a thin wrapper around all the pyglet library routines.

I'm trying to play a video, and it works great except for the fact that the audio is not synced with the video. The audio appears to start about a quarter second early. Any ideas on what I'm doing wrong?

My video layer basically looks something like this:

class VideoLayer(cocos.layer.Layer):
def __init__(self, video_path):
'''
<image> is a loaded pyglet compatible image
'''
super(VideoLayer, self).__init__()
self.video_path = video_path

def on_enter(self):
player = pyglet.media.Player()
player.eos_action = player.EOS_LOOP # Could also be EOS_PAUSE or EOS_NEXT
self.video = pyglet.media.load(self.video_path)
player.queue(self.video)
self.player = player

def draw(self):
if self.player.playing:
self.player.get_texture().blit(0,0)

draw() is called just like the on_draw() event, on_enter() is only called when the layer is viewed. 

I like I said, it looks great and the audio isn't choppy, it's just not in sync w/ the video.
Blaine

Nathan

unread,
Nov 15, 2012, 11:26:44 AM11/15/12
to pyglet...@googlegroups.com
What version of Pyglet, AVbin, and OS are you using?  What is the video format?  Can you share the video file?

~ Nathan


--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/pyglet-users/-/_YDJTATT0vwJ.

To post to this group, send email to pyglet...@googlegroups.com.
To unsubscribe from this group, send email to pyglet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en.

Reply all
Reply to author
Forward
0 new messages