Update from July 30th, 2012sfeMovie 1.0 is available, see
http://en.sfml-dev.org/forums/index.php?topic=8701.msg58578#msg58578=============================
Update from March 15th, 2012sfeMovie 1.0 RC1 is available, see
http://www.sfml-dev.org/forum/viewtopic.php?p=48199#48199=============================
Hello everyone,
Information update from 2011-05-12I'm writing here to give you the latest news about the sfeMovie project.
sfeMovie is a small C++ library that lets you play movies in SFML based applications. It relies on SFML for the rendering process and FFmpeg for the decoding process. It supports both audio and video, and basic controls. This project has been written to work closely with SFML and tries to keep the same easy-to-use paradigm, while remaining coherent with SFML's conventions.
Information and download:Most of the information is available through the
wiki page, including the
download links.
For now, sfeMovie is available to Windows and Mac OS X, and is in a beta state. Thanks to FFmpeg, sfeMovie can read many formats, including AAC, MP3, Vorbis, WMA, H.264, MPEG4, Theora, VP6 and WMV.
There is still a lot of work to do, but the current version already lets you use the main features.
I'm inviting you to test the library and write your feedback about bugs or any other issue you encountered. The
bug tracker allows you to check the already-reported bugs or upcoming features and improvements.
As for the differences with the previous versions:- all of the precompiled FFmpeg binaries have been dropped
- a script to compile everything for you has been added, it also allows you to exactly choose which decoders you want to enable
- FFmpeg is statically linked to sfeMovie, thus you don't have to care about FFmpeg dlls
- some minor bugs have been fixed
Ceylo
Original post:
Hellooo everyone,
I'm posting here to get some comments about a video class I'm currently working on. The purpose is to be able to display a video with its audio soundtrack, and to get something as easy to use as sf::Music.
It's supposed to work on all the OSs supported by SFML and has been currently successfully tested on Windows and Mac OS X. It uses SFML 1.6 and FFmpeg 0.6.1. It can be used to play videos but also to play music formats that are not supported by SFML (such as MP3).
Here is a short example on how to use the sfe::Video class :
int main()
{
sf::RenderWindow window(sf::VideoMode(640, 480), "SFE Video");
sfe::Video video;
if (!video.OpenFromFile("video.avi"))
return 1;
video.Play();
while (window.IsOpened())
{
sf::Event ev;
while (window.GetEvent(ev))
{
if (ev.Type == sf::Event::Closed)
window.Close();
}
window.Clear();
window.Draw(video);
window.Display();
}
return 0;
}
The sources, dependencies and project files (currently CodeBlocks 10.05 project for Windows and Xcode project for Mac OS X) can be downloaded from here.
Currently known issues :
- if your computer is too slow to decode the video, no video frame will be skiped, thus the video will get late
- video decoding is still not very efficient on high resolution videos on Windows (such as 1280x720)
Currently implemented features :
- video support with these formats* (short list) : FLV, H264, MPEG4, Theora, WMV
- audio support with these formats* (short list) : AAC, AC3, FLAC, MP3, PCM, Vorbis, WMA
- audio and video synchronization**
- getting some properties such as the video duration, size and framerate
- setting the sound volume
- scaling the video to fit a any frame (and every other sf::Drawable's features)
- basic video controls : play, pause, stop
Once the class gets stable enough, it'll be posted on the wiki .
* this list depends on the configuration options you use when building the FFmpeg binaries. It can includes GPL and non-free dependencies, but the default FFmpeg configuration is under the LGPL licence. See Video.h for a more detailed list of the video and audio formats supported with a basic build.
** video is synchronized until your CPU is fast enough to support the requested video framerate. If your CPU is faster, the video will keep a normal speed, but if it's too slow the video will get late. There is currently no support for skipping frames when the video decoding is late.