oggplayer: A simple Ogg player using liboggplay
To help track down performance issues, and fix some a/v synchronisation bugs, I wrote a simple Ogg player in C++ using the same libraries and a similar approach to what I use in the Firefox video implementation.
The source to 'oggplayer' is available on github.
I've setup the repository to facilitate my experimenting with different approaches and different library versions. What this means is I've taken the, probably unusual, approach of having a 'thirdparty' directory containing git submodules for each of the Ogg based libraries I'm using. I configure and build these and link statically to them. This lets me use experimental versions of the Ogg libraries without dealing with 'shared library hell'.
This is all explained in the README, but just quickly these are the steps to clone oggplayer, and get the third party libraries from git:
You'll notice the unix-centric leaning of these commands. I've only built on Linux. I'm using cross platform libraries so it should build with minor changes on Mac OS X. Mainly changing the audio library to link against in the Makefile. For Windows you'll probably need to use Cygwin or MSYS.
To run, just pass the filename on the command line:
These are the third party libraries I use, and include as submodules:
Interestingly with this example player I can play back the problematic HD video I mentioned previously. Part of this is the newer YUV conversion routines in liboggplay and the more lower level optimized SDL libraries for blitting the video data. I'm also not seeing audio buffer underruns which I see with some videos in Firefox. Time to do some investigating!
Categories: firefox, video
The source to 'oggplayer' is available on github.
I've setup the repository to facilitate my experimenting with different approaches and different library versions. What this means is I've taken the, probably unusual, approach of having a 'thirdparty' directory containing git submodules for each of the Ogg based libraries I'm using. I configure and build these and link statically to them. This lets me use experimental versions of the Ogg libraries without dealing with 'shared library hell'.
This is all explained in the README, but just quickly these are the steps to clone oggplayer, and get the third party libraries from git:
$ git clone git://github.com/doublec/oggplayer.gitOnce that's done you need to build the third party libraries:
$ cd oggplayer
$ git submodules init
$ git submodules update
$ cd thirdpartyRun 'make' to build oggplayer itself. The third party libraries are built and installed in a 'local' subdirectory.
$ sh build.sh
You'll notice the unix-centric leaning of these commands. I've only built on Linux. I'm using cross platform libraries so it should build with minor changes on Mac OS X. Mainly changing the audio library to link against in the Makefile. For Windows you'll probably need to use Cygwin or MSYS.
To run, just pass the filename on the command line:
$ ./oggplayer foo.oggPress ESC to exit the playback, and space bar to toggle full screen on supported platforms (those that SDL supports full screen).
These are the third party libraries I use, and include as submodules:
- libogg
- libvorbis
- libtheora
- liboggz
- libfishsound
- liboggplay
- libsydneyaudio
- Boost C++ libraries
- SDL
Interestingly with this example player I can play back the problematic HD video I mentioned previously. Part of this is the newer YUV conversion routines in liboggplay and the more lower level optimized SDL libraries for blitting the video data. I'm also not seeing audio buffer underruns which I see with some videos in Firefox. Time to do some investigating!
Categories: firefox, video
Labels: mozilla
