fakesink captured image size
Scot Zarkiewicz
scotzark at gmail.com
Wed Dec 14 16:13:32 UTC 2022
Sorry for the limited info. So I have an rtspsrc setup as:
rtsp://192.168.0.102:554 ! decodebin ! fakesink enable-last-sample=true
name=sink
I am using the following code to capture and convert the video frame:
capsOrig = gst_sample_get_caps(from_sample);
s = gst_caps_get_structure(capsOrig, 0);
gst_structure_get_int(s, "width", &width);
gst_structure_get_int(s, "height", &height);
caps = gst_caps_new_simple ("image/bmp",
"pixel-aspect-ratio",
GST_TYPE_FRACTION, 4, 3,
"width", G_TYPE_INT, 1440,
"height", G_TYPE_INT, 1080,
NULL);
to_sample = gst_video_convert_sample (from_sample, caps,
GST_CLOCK_TIME_NONE, &err);
I have verified the width and height are 1920 x 1080 as they are set in the
camera, so I am asking gst_video_convert_sample to crop it to 1440 x 1080
But when I render this frame in Android it is 1024x768:
val bmp = BitmapFactory.decodeByteArray(copyBuf, 0, copyBuf.size)
I have also tried using something simpler like:
caps = gst_caps_from_string("image/bmp")
But in that case I get 1024x576.
Any input would be appreciated! I am kind of stumped.
thanks,
Scot
On Wed, Dec 14, 2022 at 9:40 AM Nirbheek Chauhan <nirbheek.chauhan at gmail.com>
wrote:
> Hi Scot,
>
> You need to include more details about your code, the pipeline you are
> using, etc. Right now, you've not communicated enough information for
> anyone to figure out what you are doing, or what you could be doing
> wrong.
>
> Cheers,
> Nirbheek
>
> On Wed, Dec 14, 2022 at 6:32 AM Scot Zarkiewicz via gstreamer-devel
> <gstreamer-devel at lists.freedesktop.org> wrote:
> >
> > Hi,
> >
> > I am using fakesink to capture frames from an RTSP source. The
> resolution of the RTSP stream is 1920x1080 but when I convert the captured
> frames to JPG they are 1024x576. Is it possible to capture images at the
> full pipeline resolution?
> >
> > Thanks,
> >
> > Scot
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20221214/8662fecc/attachment.htm>
More information about the gstreamer-devel
mailing list