[Bug 785011] Sometime between 1.10.4 and 1.12.0 MKV video decode broke when mapping buffers to get pixel data

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Tue Jul 18 07:46:49 UTC 2017


https://bugzilla.gnome.org/show_bug.cgi?id=785011

--- Comment #14 from Carsten Haitzler (Rasterman) <raster at rasterman.com> ---
gst_video_convert_sample() gets me a correct output image as a png. i threw
this in:

   GstSample *from_sample, *to_sample;
   GstBuffer *buf;
   GstMapInfo map_info;
   GstCaps *caps;
   GError *err = NULL;

   g_object_get(send->sink, "last-sample", &from_sample, NULL);
   caps = gst_caps_from_string("image/png");
   to_sample = gst_video_convert_sample(from_sample, caps,
                                        GST_CLOCK_TIME_NONE, &err);
   gst_caps_unref(caps);
   gst_sample_unref(from_sample);
   buf = gst_sample_get_buffer(to_sample);
   if (gst_buffer_map(buf, &map_info, GST_MAP_READ)) {
      if (!g_file_set_contents("/home/raster/out.png",
                               (const char *)map_info.data,
                               map_info.size, &err)) {
         GST_WARNING ("Could not save thumbnail: %s", err->message);
         g_error_free (err);
      }
   }
   gst_sample_unref(to_sample);
   gst_buffer_unmap(buf, &map_info);

quick and dirty but got me out.png.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list