code your own media player in c language

Short Bytes: Using the rich ffmpeg video library written in C, you can make simple media applications. Based on the updated version of ffplay (sample program coming with ffmpeg), today I’m sharing a way to code your own media player in less than 1000 lines.

If you’are having the knowledge of libraries used for creating video applications, ffmpeg would sound another familiar name to you. This amazing general purpose library performs complex video processing work like decoding, encoding, demuxing and muxing. Written in C, this library decodes most codecs.

If you want to get started with ffmpeg, there isn’t much information available online. In this article, I’ll be sharing the tutorial I found on dranger.com that borrows a C program written by Martin Böhme and uses it to develop a working video player.

To get the video and audio output of the media file, SDL has been used as it’s a good cross-platform media library used in many video games and media software. To compile the programs that’ll be taught in the tutorial, you need to download SDL development libraries on your system and install it.

With an idea queues, mutexes etc. in C and some multimedia basics, you are good to start with making your own media player.

While the program doesn’t make a player to fulfill all your media playback needs, it should be seen as a way to learn more and discover the opportunities to make improvements in the program.

Click here to get started with the tutorial. On each page, there’s a C file that you can download, compile, and follow along.

Did you find this article helpful? Share your views in the comments below.

Now Watch: