在gstreamer中旋转视频 [英] Rotate a Video in gstreamer

查看:708
本文介绍了在gstreamer中旋转视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个管道可以同时从两个网络摄像头记录:

I have this pipeline to record from two webcams simultaneously:

gst-launch-1.0 -v v4l2src device=/dev/video0 num-buffers=300\
! "video/x-raw,width=800,height=600,framerate=30/1" ! videorate\
! "video/x-raw,framerate=30/1" ! jpegenc ! queue ! mux. \
pulsesrc device="alsa_input.pci-0000_00_1b.0.analog-stereo" \
!  'audio/x-raw,rate=88200,channels=1,depth=24' !  audioconvert ! \
avenc_aac compliance=experimental ! queue ! mux. matroskamux name="mux"\
 ! filesink location=/home/sina/T1.avi  v4l2src device=/dev/video1 \
! 'image/jpeg,framerate=30/1,width=800,height=600' ! videorate !  \
 ! queue ! mux2.  pulsesrc \
device="alsa_input.usb-046d_0990_94D7DC5E-02-Q9000.analog-mono" \
!  'audio/x-raw,rate=88200,channels=1,depth=24' !  audioconvert \
!  avenc_aac compliance=experimental ! queue ! mux2. \
matroskamux name="mux2" ! filesink location=/home/sina/T2.mts 

我想将第二个Camera(/dev/video1)的视频颠倒安装180度,该如何旋转?

I'd like to rotate the video of the second Camera (/dev/video1) by 180 since it's mounted up side down, How can I do the rotation?

推荐答案

videoflip元素可以为您完成此操作.您可能希望使用method=rotate-180作为此元素的选项.但是,这需要对图像进行重新编码(例如jpeg解码和jpeg编码).

The videoflip element can do this for your. You probably want use method=rotate-180 as option for this element. However this requires re-encoding of the image (e.g. jpeg-decode and jpeg-encode).

您可能想研究GstVideoOrientation界面. v4l2src元素实现此接口,并允许控制某些翻转选项.但是,您将需要编写我们自己的GStreamer应用程序才能访问此接口.另外,由于翻转是在硬件设备本身中完成的,因此它可能会或可能不会对您的设备起作用.

You may want to investigate the GstVideoOrientation interface. The v4l2src element implements this interface and allows control over some flipping options. You will need to write our own GStreamer application to get access to this interface though. Also since the flipping is then done in the hardware device itself it may or may not work for your device.

这篇关于在gstreamer中旋转视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆