Sign in to follow this  

liboggplayer - Play cut scenes in few lines of code.

This topic is 3341 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

liboggplayer logo
Project homepage: http://code.google.com/p/liboggplayer/ License: LGPL Liboggplayer is an easy to use library based on libogg, libvorbis and libtheora. It allows developers to get ogg videos played in few lines of code:
void mixaudio(void *data, Uint8 *stream, int len) { 
    OggPlayer* ogg=(OggPlayer*)data; 
    ogg->audio_read((char*)stream,len);
}
int main( int argc, char* argv[] ) {
    OggPlayer ogg("video.ogg",AF_S16,2,44100,VF_BGRA); 

    ...init audio and video...

    ogg.play(); 
    while( ogg.playing() ) { 
        SDL_LockSurface( screen ); 
        ogg.video_read((char*)screen->pixels,screen->pitch); 
        SDL_UnlockSurface( screen ); 
        SDL_Flip(screen); 
    }
}

See project homepage and the examples for more information. The windows binaries require Microsoft Visual C++ 2008 SP1 Redistributable Package. The Direct3D/OpenAL example requires also DirectX End-User Runtimes (August 2008) and OpenAL 1.1. A sample video is included in the binary packages. You can help me improve this library by answering the following questions: Do the examples (in bin) work on your pc? Have you noticed any problems with video to audio synchronization? Do you like the current api or would you prefer a callback style interface? Had you any problems using the library? I would appreciate any feedback. EDIT: The OpenGL and D3D samples require non power of two textures, thus they may not work correctly on older hardware. [Edited by - Kambiz on October 25, 2008 9:00:31 AM]

Share this post


Link to post
Share on other sites
Sign in to follow this