On Thu, Apr 24, 2008 at 12:44 AM, gaspa <[EMAIL PROTECTED]> wrote:
>
>  Hi,
>  i'm quite new of pyglet, and i'm trying to do stuff like shrinking and
>  cropping videos.
>  I'm enthusiastic of pyglet, cause it's really very simple, even for a
>  complete newbye as me.
>
>  But, there are always some fallback, and here's my first:
>  i'm trying to combine some videos, but with more than three/four it
>  became really slow, and I got about 0,3 frame per seconds.
>
>  This is my (really simple) drawing code:
>
>  @window.event
>  def on_draw():
>     window.clear()
>     for n,player in enumerate(players):
>         player.get_texture().blit( parameters[n][0], parameters[n][1],
>  width=video_width, height=video_height)
>     fps_display.draw()
>
>  My guess is that i'm decoding anyway all the videos, even if i don't
>  draw anything.
>  And that could sit down the application.
>  Anyway: how can I speed up this? at least to raise my "video limit".

Add more hardware, or use smaller videos or videos with simpler
encoding (for example, MPEG 1/2 instead of H.264).

>
>  I notice that my cpus doens't reach 100%, so, I could improve it using
>  more that a single CPU. there's a way to use a single thread for
>  pyglet.media.player(s) and another for the main loop? or something
>  similar..

There's no way to multithread this at the moment.  You're running into
timing issues, with the video update being blocked by each of the four
video decoders in turn.  Of course this is suboptimal, but working
around it is difficult to impossible -- you're really stretching
pyglet past it's limits/intent.

If you can deal with dependencies, there are other modules for Python
that are probably more suitable for this purpose.

Otherwise, you could spend/waste a lot of time overriding the event
loop to better distribute CPU time between the video decode updates
(currently scheduled clock functions, but you can override this) and
the rendering pass.

Alex.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to