How to convert raw BGRA image to JPG using GStreamer 1.0?

只谈情不闲聊 提交于 2019-12-08 18:04:24
karlphillip

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
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!