v4l2src and dynamic image/jpeg

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

v4l2src and dynamic image/jpeg

Matteo Valdina
Hi,
It is probably a basic question but I didn't find a good answer.

I'm trying to write a Bin that it is something like:

v4l2src ! capsfilter! vaapijpegdec ! srcpad

I would like to add and remove jpeg decoder if my target resolution requires image/jpeg or x-raw.
For example, I have some camera that provides image/jpeg and other that provide I420.

How can I approach this problem?

Should I configure the caps filter with image/jpeg and I420 and use a probe query_downstream/upstream to dynamically link/remove the jpegdec?

There is a simpler approach for that?

Best
Matteo
--
“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.”
- Tony Hoare

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: v4l2src and dynamic image/jpeg

Nicolas Dufresne-5
Le samedi 19 août 2017 à 22:39 -0500, Matteo Valdina a écrit :

> Hi,
> It is probably a basic question but I didn't find a good answer.
>
> I'm trying to write a Bin that it is something like:
>
> v4l2src ! capsfilter! vaapijpegdec ! srcpad
>
> I would like to add and remove jpeg decoder if my target resolution
> requires image/jpeg or x-raw.
> For example, I have some camera that provides image/jpeg and other
> that provide I420.
>
> How can I approach this problem?
>
> Should I configure the caps filter with image/jpeg and I420 and use a
> probe query_downstream/upstream to dynamically link/remove the
> jpegdec?
You could use decodebin, it will passthrough on raw caps. Something
like this will set the preference to jpeg:

gst-launch-1.0 -v v4l2src device=/dev/video1 ! "image/jpeg;video/x-raw" ! decodebin ! glimagesink

>
> There is a simpler approach for that?
>
> Best
> Matteo
> --
> “There are two ways of constructing a software design: One way is to
> make it so simple that there are obviously no deficiencies, and the
> other way is to make it so complicated that there are no obvious
> deficiencies. The first method is far more difficult.”
> - Tony Hoare
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (201 bytes) Download Attachment