Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: GStreamer SDK and SFML  (Read 12330 times)

0 Members and 1 Guest are viewing this topic.

Zapfyr

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • Email
Re: GStreamer SDK and SFML
« Reply #15 on: November 14, 2012, 06:59:02 pm »
Yeah, I do not expect an answer either, not only because my question is large (and vague) but because the few similar questions I bumped into when googling about the error didn't have any solutions. Debugging a general streaming error is not easy. :) I even tried to get it to work by destroying the pipeline and clean up everything when I got the EOS message and rebuild it again afterwards, this resulted in very similar (if not exact) results as seeking to the beginning. It seems to be some kind of memory problem, e.g. that I do not free something and that gstreamer runs out of some kind of internal buffer, but that is just speculation and as the actual setup of the pipeline as well as the handling (and seeking) are all in the GStreamer SDK tutorials my code should be correct ...

About sfeMovie; I have built it on Windows with everything that ffmpeg gives us. I got it to loop (not perfect but good enough, by stopping and playing when the movie reaches its end) and run it for about 26 hours (before I turned it off), which is great. :) I would love to help out with the project, I just need to find the time. Performance is probably the most important thing right now and after that looping, I am not that interested in seeking. When I did the texture upload code from GStreamer to OpenGL I got a pretty nice performance boost when I switched from using sfml textures, using the update function, to using PBO ping ponging which makes it possible to stream texture data asynchronously without blocking the CPU. Is that something that may help the sfeMovie project or do you want me to look into something else?

// Zap

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: GStreamer SDK and SFML
« Reply #16 on: November 14, 2012, 10:00:39 pm »
Hmmm ok. I'm pleased to know sfeMovie is now stable enough to run for 26 hours without crashing ;D .

The first thing to do would be to find out what is consuming most CPU time. From what I remember it's decoding, not the texture upload. We would also need to make a difference between blocking operations and CPU time consuming operations. I don't know whether we can easily make the difference.

And then if the texture update is indeed costly, yes why not give it a try with PBO. But note that I don't want to make a library that works only on specific hardware. If PBO can't be used everywhere, there *must* be a fallback method.
Want to play movies in your SFML application? Check out sfeMovie!

Zapfyr

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • Email
Re: GStreamer SDK and SFML
« Reply #17 on: September 27, 2013, 02:14:30 pm »
I know this is an old post but I felt that I should post about how it is going and share some code that may help others. I created a class that uses GStreamer to decode a movie and SFML to render it (trough some OpenGL). Note that the code wont work as it is now as I stopped working on it and left it a bit messy (sorry about that), it also need some libs (e.g. boost and GStreamer).

When it works it uses PBOs (Pixel Buffer Object) to copy pixel from RAM to VRAM, it also uses ping poing to speed up copying even more. I ran it on Windows 7 and Windows 8 using GStreamer SDKhttp://www.gstreamer.com/ and SFML 2.0.

http://tux.servegame.org/~zapfyr/VideoSprite.hpp
http://tux.servegame.org/~zapfyr/VideoSprite.cpp
« Last Edit: September 27, 2013, 02:22:14 pm by Zapfyr »