All Projects → katajakasa → Sdl_kitchensink

katajakasa / Sdl_kitchensink

Licence: mit
A Simple SDL2 / FFmpeg library for audio/video playback written in C99

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Sdl kitchensink

Ffmpeg Video Player
An FFmpeg and SDL Tutorial.
Stars: ✭ 149 (+181.13%)
Mutual labels:  cmake, sdl2, sdl, ffmpeg
Xray 16
Improved version of the X-Ray Engine, the game engine used in the world-famous S.T.A.L.K.E.R. game series by GSC Game World. Join OpenXRay! ;)
Stars: ✭ 1,806 (+3307.55%)
Mutual labels:  cmake, sdl2, sdl
Anese
Another NES Emulator - written for fun & learning - first implementation of wideNES
Stars: ✭ 323 (+509.43%)
Mutual labels:  cmake, sdl2, sdl
Div Games Studio
Complete cross platform games development package, originally for DOS but now available on modern platforms.
Stars: ✭ 168 (+216.98%)
Mutual labels:  cmake, sdl2, sdl
Pygame
pygame (the library) is a Free and Open Source python programming language library for making multimedia applications like games built on top of the excellent SDL library. C, Python, Native, OpenGL.
Stars: ✭ 4,164 (+7756.6%)
Mutual labels:  sdl2, sdl
Qmplay2
QMPlay2 is a video and audio player which can play most formats and codecs.
Stars: ✭ 310 (+484.91%)
Mutual labels:  cmake, ffmpeg
Magnum
Lightweight and modular C++11 graphics middleware for games and data visualization
Stars: ✭ 3,728 (+6933.96%)
Mutual labels:  cmake, sdl
Libsdl2pp
C++11 bindings/wrapper for SDL2
Stars: ✭ 385 (+626.42%)
Mutual labels:  sdl2, sdl
SDL.zig
A shallow wrapper around SDL that provides object API and error handling
Stars: ✭ 102 (+92.45%)
Mutual labels:  sdl, sdl2
Desktopsharing
桌面共享, 支持RTSP转发, RTSP推流, RTMP推流。
Stars: ✭ 337 (+535.85%)
Mutual labels:  sdl2, ffmpeg
Chocolate Doom
Chocolate Doom is a Doom source port that is minimalist and historically accurate.
Stars: ✭ 1,052 (+1884.91%)
Mutual labels:  sdl2, sdl
S25client
Return To The Roots (Settlers II(R) Clone)
Stars: ✭ 288 (+443.4%)
Mutual labels:  cmake, sdl
Vado
A demo web browser engine written in Haskell
Stars: ✭ 265 (+400%)
Mutual labels:  sdl2, sdl
Openspades
Compatible client of Ace of Spades 0.75
Stars: ✭ 769 (+1350.94%)
Mutual labels:  cmake, sdl2
EnttPong
Built for EnTT, at the request of the developer as a demo.
Stars: ✭ 51 (-3.77%)
Mutual labels:  sdl, sdl2
Doomretro
The classic, refined DOOM source port. For Windows PC.
Stars: ✭ 349 (+558.49%)
Mutual labels:  sdl2, sdl
Openloco
An open source re-implementation of Chris Sawyer's Locomotion
Stars: ✭ 504 (+850.94%)
Mutual labels:  cmake, sdl2
Mlt
MLT Multimedia Framework
Stars: ✭ 836 (+1477.36%)
Mutual labels:  sdl2, ffmpeg
Analysisavp
音视频学习,相关文件格式/协议分析。h264 nalu aac adts flv
Stars: ✭ 38 (-28.3%)
Mutual labels:  sdl2, ffmpeg
BonEngineSharp
A simple and fun SDL-based game engine in C#.
Stars: ✭ 16 (-69.81%)
Mutual labels:  sdl, sdl2

SDL_kitchensink

Build Status Quality Gate

FFmpeg and SDL2 based library for audio and video playback, written in C99.

Documentation is available at http://katajakasa.github.io/SDL_kitchensink/

Features:

  • Decoding video, audio and subtitles via FFmpeg
  • Dumping video and subtitle data on SDL_textures
  • Dumping audio data in the usual mono/stereo interleaved formats
  • Automatic audio and video conversion to SDL2 friendly formats
  • Synchronizing video & audio to clock
  • Seeking forwards and backwards
  • Bitmap, text and SSA/ASS subtitle support

Note! Master branch is for the development of v1.0.0 series. v0 can be found in the rel-kitchensink-0 branch. v0 is no longer in active development and only bug- and security-fixes are accepted.

1. Installation

Nowadays you can find SDL_kitchensink in eg. linux repositories. Installation might be as simple as running the following (or your distributions' equivalent):

apt install libsdl-kitchensink libsdl-kitchensink-dev

If you are running on windows/MSYS2 or on linux distributions where the package management does not have kitchensink, you will need to compile it yourself. Please see the "Compiling" section below.

2. Library requirements

Build requirements:

  • CMake (>=3.0)
  • GCC (C99 support required)

Library requirements:

  • SDL2 (>=2.0.5)
  • FFmpeg (>=3.0)
  • libass (optional, supports runtime linking via SDL_LoadSO)

Note that Clang might work, but is not tested. Older SDL2 and FFmpeg library versions may or may not work; versions noted here are the only ones tested.

2.1. Debian / Ubuntu

sudo apt-get install libsdl2-dev libavcodec-dev libavdevice-dev libavfilter-dev \
libavformat-dev libavutil-dev libswresample-dev libswscale-dev \
libpostproc-dev libass-dev

2.2. MSYS2 64bit

These are for x86_64. For 32bit installation, just change the package names a bit .

pacman -S mingw-w64-x86_64-SDL2 mingw-w64-x86_64-ffmpeg mingw-w64-x86_64-libass

3. Compiling

By default, both static and dynamic libraries are built.

  • Set BUILD_STATIC off if you don't want to build static library
  • Set BUILD_SHARED off if you don't want to build shared library
  • Dynamic library is called libSDL_kitchensink.dll or .so
  • Static library is called libSDL_kitchensink_static.a
  • If you build in debug mode (-DCMAKE_BUILD_TYPE=Debug), libraries will be postfixed with 'd'.

Change CMAKE_INSTALL_PREFIX as necessary to change the installation path. The files will be installed to

  • CMAKE_INSTALL_PREFIX/lib for libraries (.dll.a, .a, etc.)
  • CMAKE_INSTALL_PREFIX/bin for binaries (.dll, .so)
  • CMAKE_INSTALL_PREFIX/include for headers

3.1. Building the libraries on Debian/Ubuntu

  1. mkdir build && cd build
  2. cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
  3. make -j
  4. sudo make install

3.2. Building the libraries on MSYS2

  1. mkdir build && cd build
  2. cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
  3. make
  4. make install

3.3. Building examples

Just add -DBUILD_EXAMPLES=1 to cmake arguments and rebuild.

3.4. Building with AddressSanitizer

This is for development/debugging use only!

Make sure llvm is installed, then add -DUSE_ASAN=1 to the cmake arguments and rebuild. Note that ASAN is not supported on all OSes (eg. windows).

After building, you can run with the following (make sure to set correct llvm-symbolizer path):

ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer ./complex <my videofile>

4. Q&A

Q: What's with the USE_DYNAMIC_LIBASS cmake flag ?

  • A: It can be used to link the libass dynamically when needed. This also makes it possible to build the library without libass, if needed. Using this flag is not recommended however, and it will probably be deprecated in the next major version(s). If you use it, you might need to also patch the library path and name to match yours in kitchensink source.

Q: Why the name SDL_kitchensink

  • A: Because pulling major blob of library code like ffmpeg feels like bringing in a whole house with its kitchensink and everything to the project. Also, it sounded funny. Also, SDL_ffmpeg is already reserved :(

5. Examples

Please see examples directory. You can also take a look at unittests for some help. Note that examples are NOT meant for any kind of real life use; they are only meant to show simple use cases for the library.

6. FFMPEG & licensing

Note that FFmpeg has a rather complex license. Please take a look at FFmpeg Legal page for details.

7. License

The MIT License (MIT)

Copyright (c) 2020 Tuomas Virtanen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].