how do experts customize filesrc

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

how do experts customize filesrc

ericcardmanNo3
hello,

i have a h264 decoder. It comes with an API to decode single h264 frames. It also comes with
an API for frame extraction. This frame extraction code need a file descriptor of the h264 source file.

What i want to do is:

[A]
my customized filesrc (frame extraction) ----> my decoder plugin (h264 decoding) ----> fbdevsink

The decoder plugin part is ok for me. What i do not understand is how to write an own filesrc. I can not find any template.

One important basic question:

in the above pipline- when is a buffer pushed by the filesrc? i.e when i use
gst-launch videotestsrc ! ffmpegcolorspace ! fbdevsink

who calls the _transform function of the ffmpegcolorspace ??

So could someone please tell me how to implement [A] ?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: how do experts customize filesrc

ericcardmanNo3
One more thing:

for the decoder: what is the right element? transformation or plugin template?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: how do experts customize filesrc

michael smith-6-3
In reply to this post by ericcardmanNo3
On Mon, Mar 22, 2010 at 9:20 AM, ericcardmanNo3 <[hidden email]> wrote:

>
> hello,
>
> i have a h264 decoder. It comes with an API to decode single h264 frames. It
> also comes with
> an API for frame extraction. This frame extraction code need a file
> descriptor of the h264 source file.
>
> What i want to do is:
>
> [A]
> my customized filesrc (frame extraction) ----> my decoder plugin (h264
> decoding) ----> fbdevsink
>
> The decoder plugin part is ok for me. What i do not understand is how to
> write an own filesrc. I can not find any template.

'Experts' don't do it that way - a good quality gstreamer plugin will
work directly with a normal source element, not need customisation.

In this case, you've got a (presumably working) decoder - that's
great. So you just need to feed it h.264 frames. Rather than using the
code you have, that hardcodes a particular type of source (a file),
why wouldn't you just use GStreamer's existing elements to parse
files? e.g. if your file is a raw h.264 bitstream, use h264parse. If
it's an mp4 file, use qtdemux.


>
> One important basic question:
>
> in the above pipline- when is a buffer pushed by the filesrc? i.e when i use
> gst-launch videotestsrc ! ffmpegcolorspace ! fbdevsink

Here, there's no filesrc: but in this case the videotestsrc will start
a thread, and that thread will loop, pushing a buffer with every loop
iteration. So the _transform function in ffmpegcolorspace will be
called from that streaming thread.

Mike

------------------------------------------------------------------------------
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: how do experts customize filesrc

ericcardmanNo3
Dear Mike,

thanks for information.
I will try h264parse when back at office. But i do not know if that works for me.
How do i tell the framesize to h264parse? Is this done by CAPS from my decoder plugin sink pad?

Because the Frame Extraction API first extracts the stream configuration. Then it extracts the frames.
Maybe i have to implement / modify to my own h264 parsing element?

Thanks again.

Daniel.

Reply | Threaded
Open this post in threaded view
|

Re: how do experts customize filesrc

ericcardmanNo3
Hello Mike,

facing problem:

i made a copy of the gstplugin template. I havent modified anything.
When i run
gst-launch videotestsrc ! myplugin ! fbdevsink
it works and i see output on the display.

But when i run
gst-launch filesrc location=veggie.264 ! h264parse ! myplugin ! fbdevsink
gstreamer message is coming up:
WARNING: erroneous pipeline: could not link myplugin0 to fbdevsink0

Could you please tell me what is the matter here?

Thanks.