gstreamer将图像实时转换为视频

gstreamer将图像实时转换为视频,gstreamer,Gstreamer,我正在尝试使用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

我正在尝试使用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  
我需要一种结合这两个命令的方法,以便视频可以实时保存。我似乎不知道这是怎么做到的


谢谢

我从您的第一行中删除了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启动控制台错误消息