[gst-devel] gstreamer decoder

Nuno Cardoso linun77 at gmail.com
Fri Mar 19 15:35:25 CET 2010


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 <wl2776 at gmail.com>

>
>
> 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
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20100319/443d1f3b/attachment.htm>


More information about the gstreamer-devel mailing list