you might remember the basic ffmpeg video player that I did two years ago. Thanks to a sponsor, I finally got around to updating it. A massive amount of fixes, general improvements and new features have been added. I will not bother listing a changelog, because it would be way too huge. Instead, take a look at the full list of features below!
The repository is at: https://github.com/scrawl/ogre-ffmpeg-videoplayer. Pull requests are welcome!
Special thanks to Chris Robinson (of OpenAL Soft fame!) for his help.
Due to popular demand, the video player is now licensed under the MIT license (same as Ogre itself).
- Uses Ogre's resource system to open the video file, so it could be coming from an archive, or a network resource, etc.
- Writes the video to an Ogre texture, which can be used however you want (on an overlay, or somewhere in the scene, etc)
- Complete A/V sync solution.
- Multithreaded decoding.
- Basic playback control support: play/pause, seeking.
- Works with a variety of FFmpeg versions, including the Libav fork.
- Audio resampling support (using ffmpeg's swresample / libav's avresample library): can convert audio to the user's desired sample rate, sample format and channel layout.
- No audio library dependency. Audio is handled by a MovieAudioFactory, which can be implemented by the user. If no MovieAudioFactory is given, videos are played without sound. An example MovieAudioFactory using SDL_audio is included in the demo.
- Fun fact: Also works with audio-only files, so you can use it as a streaming audio player, if you want.
Video player engine dependencies:
- Ogre 1.9+
Dependencies for the demo:
- SDL2 for audio output
- OIS for keyboard controls
The demo can be built the usual cmake way:
Code: Select all
mkdir build cd build cmake .. make
Place your video files in the build folder, then run the demo using a filename as argument:
Demo playback controls:
- Space: Play/Pause
- Left/Right: Seek by 5 seconds.
- Down/Up: Seek by 30 seconds.