1

I have an C-Code for a video codec. It takes in a compressed format as an input and give out a YUV data buffer. As a standalone application i'm able to render the YUV generated using OpenGL.

Note: This codec is currently not supported by VLC/gstreamer.

My task now is to create a player using this code (that is with features such as play, pause, step, etc.). Instead of re-inventing the whole wheel, i think it would be better if i'm able to integrate my codec into gstreamer player code(for Linux).

Is it possible to achieve the above? Is there some tutorial using which i can proceed? I have searched a lot on net but was unable to find anything specific to my requirement. Any information or links specific to the above problem will be of great help to me. Thanks in advance.

-Regards

Anup Karanjkar
  • 113
  • 3
  • 3
  • 12
Zax
  • 2,870
  • 7
  • 52
  • 76
  • I have a couple of queries. 1. If this codec is of a new `MIME` type, what is the container format for the same? Is this well known? 2. Is your question for general `gstreamer` on top of `linux` or are you looking at `Android` solution also? I am asking the second question as you have tagged `stagefright` in the question – Ganesh Oct 22 '13 at 15:31
  • @Ganesh: Thanks for the reply. 1. Yes this codec is a new mime type. It is a new container format and is not yet supported by any player. So i have to completely integrate it. 2. For now i'm concentrating only on gstreamer or ffmpeg or vlc i.e. any player so that i need not reinvent the wheel again(i.e play,pause, etc.). Android will considered only after i finish with this. With this info i'm sure you can help me. Pls Help!! – Zax Oct 22 '13 at 16:57

1 Answers1

3

Since the codec and container are of new MIME types, you will have to implement a new GstElement for demuxer and codec. A simple example (for audio) is available in this location. I presume this should provide a good starting reference for you.

Some additional links:

  • To create a decoder plugin, you can refer to the vorbisdec implementation.

  • To create a demuxer, you can refer to the oggdemuxer implementation.

  • Reference to factory make

Ganesh
  • 5,880
  • 2
  • 36
  • 54
  • 1
    I have a query. Is it possible to integrate only a codec without a demux? Please reply. – Zax Oct 24 '13 at 06:13
  • @Zax.. Yes it is possible to integrate codec only. However, the question arises on how you would provide frame's to the decoder. Also, the trick modes i.e. `FFWD`, `RWND`, `SKIP` etc are mainly implemented through the parser/demuxer. How do you plan to handle the same with decoder only? – Ganesh Oct 24 '13 at 08:18
  • Thanks for the reply. So the demux provides all this information is it? What i had though was if i just integrate my codec to gstreamer framework, some internal libraries will take care of all these options. My only intention was that if i integrate it, i need not implement play, pause, fdw, rewind and other features. So according to your knowledge what do you suggest now? Please provide some suggestions so that i can proceed. – Zax Oct 24 '13 at 09:06
  • For your first query that is how i will provide frames to the decoder: I have a decoder code which takes file pointer as an input and all parsing and providing frames to the decoder and related code is present in the decoder itself. So all i need to do is provide a file pointer to my decoder. How do i do so. Please help. – Zax Oct 24 '13 at 09:10
  • @Zax.. The player engine implementation could be different for different engines, but the underlying principles are similar. If there is a generic player engine which handles the `demuxer` and `decoder` in a generic way, then your assumption is correct that once you integrate the `demuxer` and `decoder`, then the execution would be seamless. The trick modes like `FFWD`, `RWND` etc are implemented by the player engine. To handle these modes, the player engine will retrieve some metadata from the `demuxer` and realizes the scenario. If you require more details, please do raise another query.. – Ganesh Oct 26 '13 at 14:04
  • 1
    @Zax.. If the decoder is capable of reading the container format directly and extract the elementary stream, then it is good. However, integration into `GStreamer` framework will require a _rethink_. The `codec` will then have to handle the `FFWD`, `RWND`, `SEEK` etc. I feel a better way would be to separate the container parsing and actual decoding which can make your integration easy.. – Ganesh Oct 26 '13 at 14:48
  • Thanks for the reply. Regarding the above comment, if i integrate my decoder into the framework will it be atleast be able to play/pause a video? Also it would be really helpful if you could provide a little detailed steps on integration of decoder into the framework. I have searched almost every possible place but not finding any good guide to proceed. – Zax Oct 28 '13 at 04:52