JPEG Encoding Issue in Appsrc Pipeline

Michael Gruner michael.gruner at ridgerun.com
Thu Aug 10 17:53:26 UTC 2023


Hi

1. The first place to look for problems is the GST_DEBUG output. Do you see any error there?

GST_DEBUG=2 ./app

2. The caps in the appsrc are wrong. You are not receiving JPEG frames, but raw frames:

    GstCaps *caps = gst_caps_new_simple("image/jpeg", "width", G_TYPE_INT, captureWidth, "height", G_TYPE_INT, captureHeight, NULL);

Change it to "video/x-raw" and set the correct format and framerate as well. It's easier if you use a videoparse element and set the correct properties.

Michael

> On 10 Aug 2023, at 10:00, Sulthan Amanu via gstreamer-devel <gstreamer-devel at lists.freedesktop.org> wrote:
> 
> Hello Team,
> 
> I am reaching out regarding an issue I encountered in my application. I have been attempting to save JPEG image files from an appsrc. In my application, I receive raw frames from a webcam source through the identity plugin, which I store in a local variable called "buflist". I then aim to convert this buffer (buflist) into a JPEG file using the jpegenc plugin. However, I have run into difficulties as the jpegenc plugin fails to encode the raw buffer frame successfully.
> 
> I took the initiative to investigate further by introducing an additional identity element into the appsrc pipeline. This allowed me to gather information and ascertain that I can indeed save the raw frames without encoding. They are stored as image files. However, the problem arises when I try to implement jpegenc for encoding. After adding jpegenc to the pipeline followed by the identity element, I noticed that I no longer receive frames callback.
> 
> I would like to emphasize that I would prefer alternatives to using the tee element or branching the pipeline concept. While I understand that the tee element could potentially offer a solution, it affects the overall pipeline. Furthermore, incorporating jpegenc introduces a delay in frame encoding, which is why I pursued the approach of capturing frames from the actual pipeline and subsequently saving them using multifilesink or sending them through a UDP sink.
> 
> For your convenience, I have included the relevant code below. I kindly request your assistance in identifying a solution within the context of my code.
> 
> **CODE in mail attachment **
> 
> I eagerly await your guidance and appreciate your help in resolving this matter.
> 
> Regards,
> Sulthan Amanu
> <GST_CODE.odt>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20230810/c5e1ea67/attachment.htm>


More information about the gstreamer-devel mailing list