SFML community forums

General => SFML projects => Topic started by: zsbzsb on August 28, 2014, 07:22:48 pm

Title: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
Post by: zsbzsb on August 28, 2014, 07:22:48 pm
What is it?

Motion and MotionNET is a rewrite of my earlier project VideoStreamer (http://en.sfml-dev.org/forums/index.php?topic=12305.0). In essence, it is nice wrapper around FFMPEG (https://www.ffmpeg.org/) 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]

Licensing

Motion / 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


How do I use it?

Here is a snippet from the included example program.

(click to show/hide)

Documentation

There 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 (http://zbrown.net/projects/motion/downloads) and here (https://bitbucket.org/zsbzsb/motion/downloads). 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 (https://bitbucket.org/zsbzsb/motion) and Github (https://github.com/zsbzsb/Motion) if you wish to compile it yourself.

Feedback

I welcome any and all feedback, whether it be a bug report or criticism - feel free to post in this thread or contact me directly.
Title: Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
Post by: TheKingArthur on August 28, 2014, 11:12:01 pm
Good idea, I'm going to test !
Title: Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
Post by: Ztormi on August 29, 2014, 10:12:28 am
This is something I've been looking for. I'll have to try the .NET version out. Thanks for the binding!

I wasn't even aware of your earlier version  :-\
Title: Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
Post by: Lo-X on August 29, 2014, 01:13:47 pm
Nice ! I could use it to add cinematics and intros into games or a lot of other stuff.

Great job, thanks for sharing.
Title: Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
Post by: TheKingArthur on August 29, 2014, 04:15:53 pm
When we draw the VideoPlayBack, the sound is play too ? Or we must to play the AudioPlayBack in same time ?

Sorry for my english but i'm french.
Title: Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
Post by: zsbzsb on August 29, 2014, 04:24:09 pm
Once you call Play() on the data source the sound will begin playing if you have already created an AudioPlayback object.

And thanks for the other comments guys.  :D
Title: Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
Post by: TheKingArthur on August 30, 2014, 08:38:45 am
ok thank !
Title: Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
Post by: zsbzsb on March 13, 2015, 07:44:34 pm
I just updated the first post with precompiled binaries (windows only at the moment) and links to my new site (http://www.zbrown.net/).  :D
Title: Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
Post by: UltimaN3rd on May 20, 2015, 01:46:39 am
Hi, I'm having trouble using the library in my C++ SFML application. I downloaded the precompiled library for VS12 32-bit, but there were no include files. I suppose for those I have to build the library myself - I've built a couple of libraries but I'm having trouble with this one. I'm getting the error:

CMake Error at src/Motion/CMakeLists.txt:26 (find_package):
  By not providing "FindSFML.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "SFML", but
  CMake did not find one.

  Could not find a package configuration file provided by "SFML" (requested
  version 2) with any of the following names:

    SFMLConfig.cmake
    sfml-config.cmake

  Add the installation prefix of "SFML" to CMAKE_PREFIX_PATH or set
  "SFML_DIR" to a directory containing one of the above files.  If "SFML"
  provides a separate development package or SDK, be sure it has been
  installed.

I guess this means I need some kind of SFML files for cmake to use in the build process, but after an hour of googling frankly I have no idea what I'm doing. Could you help me out?

Thanks,

UltimaN3rd
Title: Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
Post by: DarkRoku12 on May 20, 2015, 02:19:39 am
Great feature!. ;D

I probably include this in my engine, a lot of game programmers use cinematics on the game.

Thanks for the excellent contribution. All the users of SFML will enjoy this.

My game engine topic:
http://en.sfml-dev.org/forums/index.php?topic=18074.0
Title: Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
Post by: TodesBrot on June 29, 2015, 04:43:17 pm
I tried to use this library, but Visual Studio kept telling me it can't find Motion.dll, although I've included every single file that was in the downloaded zip file in my project and added a reference to MotionNet. Do you know how to solve this problem?
Title: Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
Post by: zsbzsb on June 30, 2015, 05:35:05 pm
You need to place the Motion.dll file from inside the lib folder next to your executable (or in a path that the OS will search).
Title: Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
Post by: TodesBrot on June 30, 2015, 06:11:22 pm
I did, which is why I'm so confused. The file is right next to the exe that gets compiled, and I put the file into my project so it automatically gets copied whenever I compile it. There should be no reason why it can't find the dll.
Title: Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
Post by: kitteh-warrior on June 30, 2015, 06:33:54 pm
Is the project's working directory the location of the executable? It usually is set to the project folder by default. Have you tried simply launching the executable (with the .dll in the same directory) without your IDE?
Title: Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
Post by: TodesBrot on June 30, 2015, 06:37:36 pm
Yes and yes. It did not work :/
Title: Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
Post by: zsbzsb on June 30, 2015, 11:56:19 pm
The file is right next to the exe that gets compiled... There should be no reason why it can't find the dll.

Make sure you also have all the extlibs next to the executable.
Title: Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
Post by: FallenWyvern on March 09, 2017, 09:57:32 pm
If all the ext libs are copied, motion and motionnet dll's are next to the executable, what then?
Title: Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
Post by: GuyWithDogs on April 23, 2017, 10:04:33 pm
Late to the game on this...

My problem: Trying to create a quick video player prototype on Ubuntu 16.04 32-bit in using C# in Monodevelop. By trial, error, searching and guesswork, I'm at a point where I'm getting an error "System.DllNotFoundException Motion". Any ideas? Do I need a "Linuxified" version of Motion.dll? If so, how do I get that?

Background:

Looking for a cross-platform video playback solution and ran across Motion.NET via Google searching. Much Google searching with different keywords.

I'm a Windows programmer (mostly C# .NET for the last few years, including some old Windows CE 6.0 work) with little Linux development experience. I grabbed Motion.NET and got that working on my Windows box in an amazingly short time.

I've got Ubuntu 16.04 32-bit installed. with MonoDevelop and various packages via Synaptic Package Manager.

I've got DllMaps set up that seem to have gotten me past the issues with finding the csfml* equivalents in libsfml* (thanks to various posts in these forums).

I have the Motion.dll from the \lib folder copied to my output directory.

I grabbed the Motion source from the github location and tried running "cmake ." in the folder where I extracted the code. It reports errors about being unable to find SFML, with some suggestions that probably make sense to someone who has banged their head on Linux dev with cmake for a while. That's not me.

So I get the feeling that I'm perilously close to a breakthrought, but I've run into something that I can't figure out. And "Motion.Net" is a lousy search term in Google ... I'm matching all sorts of bizarre things.