我们正在尝试使用jpegenc拍摄快照,使用gst-launch-1.0命令可以正常工作
命令:
dev0="/dev/video0"
textoverlay="textoverlay font-desc=\"Sans 12\" valignment=top halignment=left shaded-background=no"
clockoverlay="clockoverlay halignment=right valignment=top shaded-background=no time-format=\"%Y/%m/%d %a %H:%M:%S\""
gst-launch-1.0 v4l2src device=/dev/video0 ! queue ! ${textoverlay} text=${dev0} ! ${clockoverlay} ! vspmfilter ! video/x-raw,width=640,height=480 ! videorate ! video/x-raw,width=640,height=480,framerate=1/1 ! jpegenc quality=95 ! multifilesink location=/home/root/images/image_%d.jpg
这工作正常,但是当我们将相同的命令更改为gstd时,我们从gstd收到分段错误,我的gstd命令为
命令:
dev0="/dev/video0"
textoverlay="textoverlay font-desc=\"Sans 12\" valignment=top halignment=left shaded-background=no"
clockoverlay="clockoverlay halignment=right valignment=top shaded-background=no time-format=\"%Y/%m/%d %a %H:%M:%S\""
$gstd &
$gstd-client pipeline_create video0snapshot v4l2src device=/dev/video0 ! queue ! ${textoverlay} text=${dev0} ! ${clockoverlay} ! vspmfilter ! video/x-raw,width=640,height=480 ! videorate ! video/x-raw,width=640,height=480,framerate=1/1 ! jpegenc quality=95 ! multifilesink location=/home/root/images/image.jpg
$gstd-client pipeline_play video0snapshot
$gstd-client pipeline_delete video0snapsho
我们没有得到图像或图像已损坏,但是当我们在播放不带textoverlay和clockoverlay的gstd-client命令时,我们没有收到任何错误,它运行正常
命令:
$gstd-client pipeline_create video0snapshot v4l2src device=/dev/video0 ! queue ! vspmfilter ! video/x-raw,width=640,height=480 ! videorate ! video/x-raw,width=640,height=480,framerate=1/1 ! jpegenc quality=95 ! multifilesink location=/home/root/images/image.jpg