How to rotate image clockwise?

According to this the gstreamer pipeline

gst-launch videotestsrc ! videoflip method=clockwise ! ffmpegcolorspace ! ximagesink

rotates a video stream clockwise. I have tested this video pipeline in the past on an embedded-Linux Leopardboard successfully but I need to rotate individual images so I modified the pipeline like this:

gst-launch filesrc location=test.jpeg ! videoflip method=clockwise ! ffmpegcolorspace ! filesink location=testClockwise.jpeg

My modified pipeline causes the following errors:

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstVideoFlip:videoflip0: 
   not negotiated
Additional debug info:
../../../../src/libs/gst/base/gstbasetransform.c(2253): 
   gst_base_transform_handle_buffer (): 
   /GstPipeline:pipeline0/GstVideoFlip:videoflip0:
not negotiated
ERROR: pipeline doesn't want to preroll.

Why is GstVideoFlip:videoflip0 not negotiated? Why doesn't the pipeline want to preroll? How do I fix these errors?

Edit: So. I add jpegdec and jpegenc to my pipeline like this:

gst-launch filesrc location=test.jpeg ! jpegdec ! videoflip method=clockwise ! ffmpegcolorspace ! jpegenc ! filesink location=testClockwise.jpeg

but now get this error:

WARNING: erroneous pipeline: no element "jpegdec"

But why, since jpegdec and jpegenc are both in gst-plugins-good Elements?


Your pipeline reads a jpeg. Not a YUV/RGB. So you need to decode your jpeg file, flip it the way you are doing, reencode it to jpeg and then write it to a file.

链接地址: http://www.djcxy.com/p/7636.html

上一篇: 使用gstreamer将同步的视频和音频记录到容器文件中

下一篇: 如何顺时针旋转图像?