What is it?Motion and MotionNET is a rewrite of my earlier project
VideoStreamer. In essence, it is nice wrapper around
FFMPEG that allows you to playback any video or just audio files with FFMPEG as the decoder. As FFMPEG supports a huge variety of formats, these can all be used - just please be aware that all these codecs are not free.
This has been complete for a while now, its just now that I feel like releasing it more into the wild. For a while now I have also had some other guys using it (and stress testing it) and there doesn't appear to be any issues that prevent anyone else from using it.
Motion is a C++ object oriented library and can easily be used with native SFML. Motion also includes a C interface built in that can allow it to be used in SFML bindings. MotionNET is a binding of Motion that supports the SFML.NET binding making it easy to use in managed languages also. Please note that MotionNET is entirely optionally making Motion a great option for use in cross platform C++ applications.
Who uses it?I use it in one of my personal projects.
[more to come soon once I get links]LicensingMotion / MotionNET are both licensed with the ZLIP/PNG, the license same as SFML. That way you can do whatever you want with it (just don't claim you wrote it). Feel free to write patches and make pull requests, I will gladly accept anyone that feels like contributing.
Features- Greatly improved performance compared to VideoStreamer
- Fully featured video or audio playback
- Full playback control with play/pause/stop
- Supports any codec/format FFMPEG supports
- Supports seeking to any position during video/audio playback
- Synchronizes video and audio playback to elapsed time (audio will keep in sync with video)
- Audio resampling in case the input format is not signed 16 bit integers
- Cross platform - successfully tested on Windows/Linux (requires C++11 compiler)
- Playback video and audio independent of the other, or playback both at the same time
How do I use it?Here is a snippet from the included example program.
mt::DataSource datasource; // create the data source from which playback will happen
if (!datasource.LoadFromFile("{video file path}")) // load a file into the data source
return EXIT_FAILURE;
mt::AudioPlayback audioplayback(datasource); // create an audio playback from our data source
mt::VideoPlayback videoplayback(datasource); // create a video playback from our data source
datasource.Play(); // start playback
// standard SFML game and event loops
// some standard SFML code omitted for brevity
while (window.isOpen())
{
datasource.Update(); // update the data source - this is required for any playback
window.clear();
window.draw(videoplayback); // draw the video playback
window.display();
}
DocumentationThere is no documentation currently available, that said however - Motion is fairly straight forward and I plan on finishing the documentation of the public API very shortly. If you have any questions on usage feel free to contact me.
Where do I get it?There is a a few precompiled binaries available from
here and
here. If a version matching your compiler isn't available feel free to compile it yourself. Just remember SFML 2.2+ and FFMPEG are required.
Source code is available on
Bitbucket and
Github if you wish to compile it yourself.
FeedbackI welcome any and all feedback, whether it be a bug report or criticism - feel free to post in this thread or contact me directly.