gstreamer decoder

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

gstreamer decoder

Nuno Cardoso-2
Hi all!

The gstreamer framework uses ffmpeg codecs to encode/decode data? The problem is that: I have a mini video surveillance system that runs on linux, and I developed a decoder plugin based on ffmpeg and Intel IPP. The configuration file tells what is the decoder plugin to use (ffmpeg or IPP shared libraries) to decode compressed images. What I need to now is that: the decoders that gstreamer uses are the same that ffmpeg implements? Or can I develop a gstreamer plugin for my application that uses decoders from gstreamer?

thanks,
Nuno Cardoso.

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gstreamer decoder

Sean McNamara-4
Hi,

On Fri, Mar 19, 2010 at 8:08 AM, Nuno Cardoso <[hidden email]> wrote:

> Hi all!
>
> The gstreamer framework uses ffmpeg codecs to encode/decode data? The
> problem is that: I have a mini video surveillance system that runs on linux,
> and I developed a decoder plugin based on ffmpeg and Intel IPP. The
> configuration file tells what is the decoder plugin to use (ffmpeg or IPP
> shared libraries) to decode compressed images. What I need to now is that:
> the decoders that gstreamer uses are the same that ffmpeg implements? Or can
> I develop a gstreamer plugin for my application that uses decoders from
> gstreamer?

gst-ffmpeg supports most codecs that your system's ffmpeg installation
supports. Gstreamer also has its own suite of plugins not dependent on
ffmpeg that reside in the packages gst-plugins-*, gst-opengl, and so
forth.

To answer your first question: only if you want it to be that way. If
your pipeline contains ffmux_*, ffdemux_* or similar elements, those
will call directly into ffmpeg for the low-level codec operations.

To answer your second question: I'm assuming by "gstreamer plugin for
my application" that you mean your app has a multiple multimedia
backend architecture. If that's the case, then you can almost
certainly make your app a gstreamer client (link against gstreamer or
import the python modules) as one alternative, and as part of that
functionality, you can use gstreamer elements that rely on ffmpeg,
such as ffdemux_*.

If I understand you correctly, you have developed a custom codec
within the ffmpeg library, and you want to expose that to gstreamer
clients. To do that, you will probably have to hack on the
gstreamer-ffmpeg sources to enable that. I've never hacked on
gst-ffmpeg, and this HACKING guide may be completely outdated, but the
current advice (
http://cgit.freedesktop.org/gstreamer/gst-ffmpeg/tree/HACKING )
suggests that you will need to make some relatively simple additions
to expose your codec. That's assuming, of course, that your codec is a
"proper' ffmpeg codec that implements the right interfaces in the
public ffmpeg API. If not, you'll have a harder time binding it.

HTH,

Sean

>
> thanks,
> Nuno Cardoso.
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gstreamer decoder

wl2776
Administrator
In reply to this post by Nuno Cardoso-2
Nuno Cardoso-2 wrote
The gstreamer framework uses ffmpeg codecs to encode/decode data?
Most of codecs don't use ffmpeg's codecs.
There is a separate plugin, gst-ffmpeg, which uses ffmpeg's muxers, demuxers and codecs.

Nuno Cardoso-2 wrote
Or can I develop a gstreamer plugin for my application that uses decoders from
gstreamer?
Surely, nothing can stop you from developing a plugin.
There is a Plugin Writers' Guide and a template, which you can get from git repository.

However, FFmpeg is very different from the GStreamer in the concepts.
FFmpeg allows you to get an encoded frame or a decoded picture in memory (and encoding also).
If you need to draw it, or sync with audio data, then you're on your own.

GStreamer provides a pipeline, allowing media data to stream from a source (file, device, network server, ...) to a sink (screen, sound card, file, etc) and takes care about synchronization.
Reply | Threaded
Open this post in threaded view
|

Re: gstreamer decoder

Nuno Cardoso-2
My application had a pipeline execution model based on plugin filters, like GStreamer and DirectShow:

    aquisition => decompression => processing => vizualization => compression => storage => transmission

The main codecs that the decompression uses are: jpeg, mpeg4 and h264 (the codecs used by camera manufacturers). If I run my application in a Intel based machine, I'm using Intel IPP to do the decoding, but if I'm using a AMD or some kind of embeded systems that uses ffmpeg, I use ffmpeg to decode frames. Suppose that I want to use OMAP from Texas Instruments.... that board uses GStreamer with a plugin from texas that use the texas DSP. Is it possible I call a Gstreamer API to do only the decoding step? like I do with ffmpeg....

bool load_decoder(...) {
         /* alloc and initialize AVCodecContext */
         m_pCodecCtx = avcodec_alloc_context();
   
/* set AVCodecContext properties */
    m_pCodecCtx->codec_type = CODEC_TYPE_VIDEO; /* video codec type */

    if (_cameraInfo.decoder == "mpeg4") {
        m_pCodecCtx->codec_id = CODEC_ID_MPEG4; /* MJPEG decoder id */
    } else if (_cameraInfo.decoder == "jpeg") {
        m_pCodecCtx->codec_id = CODEC_ID_MJPEG; /* MJPEG decoder id */
    } else if (_cameraInfo.decoder == "h264") {
        m_pCodecCtx->codec_id = CODEC_ID_H264; /* MJPEG decoder id */
    }       
   
    m_pCodecCtx->width = _cameraInfo.width; /* image width */
    m_pCodecCtx->height = _cameraInfo.height; /* image height */
    m_pCodecCtx->flags |= CODEC_FLAG_EMU_EDGE | CODEC_FLAG_PART;
   
    /* find the decoder for the video stream */
    m_pCodec = avcodec_find_decoder(m_pCodecCtx->codec_id);
    if (!m_pCodec) {
        m_strError = string("Unable to locate codec decoder");
        return false;
    }

    /* open codec */
    if (avcodec_open(m_pCodecCtx, m_pCodec) < 0) {
        m_strError = "Cannot open codec";
        return false;
    }

    /* alloc audio/video frame */
    m_pFrame = avcodec_alloc_frame();
    if (!m_pFrame) {
        m_strError = "Cannot alloc audio/video frame";
        return false;
    }
}




2010/3/19 wl2776 <[hidden email]>


Nuno Cardoso-2 wrote:
>
> The gstreamer framework uses ffmpeg codecs to encode/decode data?
>
Most of codecs don't use ffmpeg's codecs.
There is a separate plugin, gst-ffmpeg, which uses ffmpeg's muxers, demuxers
and codecs.


Nuno Cardoso-2 wrote:
>
> Or can I develop a gstreamer plugin for my application that uses decoders
> from
> gstreamer?
>
Surely, nothing can stop you from developing a plugin.
There is a Plugin Writers' Guide and a template, which you can get from git
repository.

However, FFmpeg is very different from the GStreamer in the concepts.
FFmpeg allows you to get an encoded frame or a decoded picture in memory
(and encoding also).
If you need to draw it, or sync with audio data, then you're on your own.

GStreamer provides a pipeline, allowing media data to stream from a source
(file, device, network server, ...) to a sink (screen, sound card, file,
etc) and takes care about synchronization.
--
View this message in context: http://n4.nabble.com/gstreamer-decoder-tp1599272p1599309.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gstreamer decoder

wl2776
Administrator
Nuno Cardoso-2 wrote
Suppose that I want to use OMAP from Texas Instruments.... that
board uses GStreamer with a plugin from texas that use the texas DSP. Is it
possible I call a Gstreamer API to do only the decoding step? like I do with
ffmpeg....
I'm afraid that's a hard hackish work.

To do it, you have to simulate the environment, which a bin gives to an element.
This will require digging deeply in GStreamer's binary interface in order to get pointers to the functions and call them with the prepared structures.

http://www.gstreamer.net/data/doc/gstreamer/head/gstreamer/html/GstPlugin.html
Plugin DLLs on windows export only gst_plugin_desc, which is a structure.
Reply | Threaded
Open this post in threaded view
|

Re: gstreamer decoder

wl2776
Administrator
wl2776 wrote
Nuno Cardoso-2 wrote
Suppose that I want to use OMAP from Texas Instruments.... that
board uses GStreamer with a plugin from texas that use the texas DSP. Is it
possible I call a Gstreamer API to do only the decoding step? like I do with
ffmpeg....
I'm afraid that's a hard hackish work.
Sorry, forgot a very important thing.
There are an appsrc and an appsink elements, which allow you to feed a pipeline with your application generated data and get pipeline's data into your application.
So, you can set up a small bin: appsrc -> decoder -> appsink and get the output of the appsink  (decoded samples) into your application.