我正在尝试使用gstreamer将图像实时保存为视频格式,因为它们正在被捕获。我有保存图像的命令。这一行是:
gst-launch -e v4l2src device=/dev/video0 ! 'image/jpeg,width=640,height=480,framerate=30/1' ! jpegdec ! timeoverlay halign=right valign=bottom ! clockoverlay halign=left valign=bottom time-format="%Y/%m/%d %H:%M:%S" ! tee name=t ! queue ! sdlvideosink t. ! queue ! videorate ! capsfilter caps="video/x-raw-yuv,framerate=1/1" ! ffmpegcolorspace ! jpegenc ! multifilesink location="./Desktop/frames/frame%06d.jpg"此命令将图像保存到文件夹中。我写了另一个命令来拍摄这些照片并将它们保存到视频中。此命令为:
gst-launch -e multifilesrc location=./Desktop/frames/frame%06d.jpg ! image/jpeg,framerate=30/1 ! decodebin ! videoscale ! video/x-raw-yuv ! progressreport name=progress ! avimux ! filesink location=test.avi 我需要一种方法来组合这两个命令,以便视频可以被实时保存。我似乎弄不明白这是怎么做到的。
谢谢!
发布于 2012-06-09 09:32:13
我从你的第一行中去掉了multifilesink元素,并在第二行添加了avimux和filesink (并为这个论坛设置了更好的格式),以生成以下内容:
gst-launch -e v4l2src device=/dev/video0 ! \
'image/jpeg,width=640,height=480,framerate=30/1' ! \
jpegdec ! timeoverlay halign=right valign=bottom ! \
clockoverlay halign=left valign=bottom time-format="%Y/%m/%d %H:%M:%S" ! \
tee name=t ! \
queue ! \
sdlvideosink t. ! \
queue ! \
videorate ! \
capsfilter caps="video/x-raw-yuv,framerate=1/1" ! \
ffmpegcolorspace ! \
jpegenc ! \
avimux ! \
filesink location=test.avi不确定它是否可以工作,而且它还会丢弃progressreport组件(不确定它是如何工作的)。如果命令行失败,请发布gst-launch控制台错误消息。
https://stackoverflow.com/questions/10934508
复制相似问题