"how to convert raw bgra image to jpg using gstreamer 1.0?" Code Answer

5

solved! the 2 major issues i faced were:

  • dump.bin was a symlink on my system (cygwin) and for some reason gst-launch-1.0 was unable to work with it;
  • when working with raw data, one must specify the blocksize for filesrc.

gst-launch-1.0.exe -v filesrc location=dumped.bin blocksize=1920000 ! video/x-raw,format=bgra,width=800,height=600,framerate=1/1 ! videoconvert ! video/x-raw,format=rgb,framerate=1/1 ! jpegenc ! filesink location=out.jpg

on this specific case i also needed to flip the image vertically because it was captured from the opengl framebuffer of a 3d application:

gst-launch-1.0.exe -v filesrc location=dumped.bin blocksize=1920000 ! video/x-raw,format=bgra,width=800,height=600,framerate=1/1 ! videoconvert ! video/x-raw,format=rgb,framerate=1/1 ! videoflip method=vertical-flip ! jpegenc ! filesink location=out.jpg
By Luke Kroon on September 20 2022

Answers related to “how to convert raw bgra image to jpg using gstreamer 1.0?”

Only authorized users can answer the Search term. Please sign in first, or register a free account.