• Forum
  • Lounge
  • SFML Question - Displaying Video on menu

 
SFML Question - Displaying Video on menu screen

closed account (3qX21hU5)
So just looking for some ideas on how to implement this in a game I am working on. I also posted this in the lounge cause it doesn't really deal with the actual code necessarily but the concepts behind implementing it.


Question - Displaying video in SFML.

So my question is how would you go about displaying a short video clip on a menu screen in SFML? You know how in some game when you select a level from the menu that you want to play it shows you usually a little screenshot for that level (Here is a example of kind of what I want http://1.bp.blogspot.com/-qTw5_p7TVD0/Uhm3NJm4ENI/AAAAAAAAAPw/FtCV3Ki3VQ0/s1600/Select2.png ). I was thinking of taking a bit further like some games do and displaying a short video clip of that level in action.

How would you go about implementing something like this? I really haven't dealt with videos in programming so don't really know all that it involves. Would it be best to grab a library made for video playback and use it alongside SFML? If so any suggestion on a library that would work well alongside SFML?
Last edited on
I used the extension sfe::Movie quite some time ago, not sure if it's still up to date. It makes loading/playing a video very similar to loading/displaying a texture. It might not work with the newer versions of SFML though.

http://en.sfml-dev.org/forums/index.php?topic=3463.0
If you look around a bit more you can probably find something more recent.
closed account (o1vk4iN6)
You could just create a sequence of images and play them inorder for each frame (this would potentially limit the length of the video, every image would be stored in the GPU). If you want to play mp4, avi, etc... files then that might be more expensive and would require I imagine basically a small media player where you simply display the output where you want it on the screen. Would probably be easier just to look for a library than make your own for this case.
closed account (3qX21hU5)
ModShop wrote:
I used the extension sfe::Movie quite some time ago, not sure if it's still up to date. It makes loading/playing a video very similar to loading/displaying a texture. It might not work with the newer versions of SFML though.


Thanks will check that one out seems just like what I was looking for.


You could just create a sequence of images and play them inorder for each frame (this would potentially limit the length of the video, every image would be stored in the GPU).


I was thinking about this also but as you mentioned it would have the downside of having to be very short limit on the video I would imagine (I was hoping to get anywhere from 10-30 seconds).

I was also wondering wouldn't this route have a pretty big performance problem? Depending on how many levels their are it could be a huge amount of textures and memory so probably wouldn't be able to load them up in the beginning and store in memory. So that would mean I would need to load them when the user switches level selections.

Though I am not sure on this might give it a try to test it out. Though I have a feeling streaming a video file like mp4 or avi might be less demanding on the performance aspect.
Topic archived. No new replies allowed.