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

8 Comments:
What would be great is if you could make an ogg audio player available within the Mozilla platform through XPCOM. Standard mailnews (eg Thunderbird) notification uses sounds in the .wav format through the nsISound interface. My extension ToneQuilla makes that more flexible, and in the process I try to ship a few .wav sounds for use with email notification - but they are huge, even for 4 second notifications. I would love to use .ogg instead.
a screenshot would be nice :-)
Nice, but not very interesting since it would just be a frame of the video. There's no controls, border, or anything :)
I'll do a desktop screenshot with it running maybe.
hmm, does it have any keyboard control for basic playback control like pause/play (and maybe skip forward/backward, volume up/down)?
Not yet, But I'll be adding these. The main goal was to use it to test playback performance. Now that I've got good performance there I'll look at seeking and add keyboard controls for it.
I would definitely consider it as a daily software if it were a keyboard control only free format player with no gui clutter.
BTW, I couldn't figure out the license type from the README. Is it free (as in freedom, and endorable by FSF)?
p.s. I would definitely prefer a GPLv3 license, but a minimal freedom is a must for me.
Thanks for the comments, I'll get the keyboard commmands working.
It's under a bsd/mit license. It's show in the README and at the bottom of oggplayer.cpp. I picked that so people could copy/paste code into any project to encourage liboggplay usage.
fair enough...
...though i'd still prefer gpl ;-)
Post a Comment
<< Home