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

Author Topic: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player  (Read 25376 times)

0 Members and 2 Guests are viewing this topic.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
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]

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

  • 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.

(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 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.

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.
« Last Edit: March 13, 2015, 07:43:35 pm by zsbzsb »
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

TheKingArthur

  • Guest
Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
« Reply #1 on: August 28, 2014, 11:12:01 pm »
Good idea, I'm going to test !

Ztormi

  • Jr. Member
  • **
  • Posts: 71
  • Web developer by day. Game developer by night.
    • View Profile
Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
« Reply #2 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  :-\

Lo-X

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
    • My personal website, with CV, portfolio and projects
Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
« Reply #3 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.

TheKingArthur

  • Guest
Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
« Reply #4 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.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
« Reply #5 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
« Last Edit: August 29, 2014, 04:27:48 pm by zsbzsb »
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

TheKingArthur

  • Guest
Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
« Reply #6 on: August 30, 2014, 08:38:45 am »
ok thank !

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
« Reply #7 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:D
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

UltimaN3rd

  • Newbie
  • *
  • Posts: 1
    • View Profile
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

DarkRoku12

  • Full Member
  • ***
  • Posts: 203
  • Lua coder.
    • View Profile
    • Email
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
I would like a spanish/latin community...
Problems building for Android? Look here

TodesBrot

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
« Reply #10 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?

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
« Reply #11 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).
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

TodesBrot

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
« Reply #12 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.

kitteh-warrior

  • Guest
Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
« Reply #13 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?

TodesBrot

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: Motion [C++] / MotionNET [C#] - Complete SFML Video and Audio player
« Reply #14 on: June 30, 2015, 06:37:36 pm »
Yes and yes. It did not work :/

 

anything