我正在使用 gstreamer (gst-launch) 捕获相机并将流保存为视频和图像帧。管道的问题是,当管道完成(通过中断)视频记录时,它不能支持位置跟踪和查找。因此,视频在 vlc 播放器中播放,长度未知。我认为问题出在管道本身。如何实现支持位置跟踪和寻找。
下面您可以看到 gstreamer 管道代码:
gst-launch -v --gst-debug-level=0 \
v4l2src device=/dev/video0 \
! videorate \
! video/x-raw-yuv, width=320, height=240, framerate=5/1 \
! tee name=tp
tp. \
! queue \
! videobalance saturation=0.0 \
! textoverlay halign=left valign=top text="(c)PARK ON OM " shaded-background=true \
! clockoverlay halign=right valign=top time-format="%D %T " text="Date:" shaded-background=true \
! queue \
! ffmpegcolorspace \
! ffenc_mpeg4 \
! avimux \
! filesink location=/ram/pmc/recordCAM1.mp4 \
tp. \
! queue \
! jpegenc \
! multifilesink location=/ram/pmc/webcam1.jpeg &
pipeline的解释如下:
______________ ________ _______ ________________
|convert into|->|append|->|encode| -> |save file as |
_________________ ________________ _____________ | grayscale | |text | |ffenc | | recordCAM1.mp4 |
| use /dev/video |-> |set framerate |-> |multiplexer|->
| as input source| |and resolution| | named tp |->
__________ _________________
|jpeg enc|->|save to filesink|
| encode | | as jpeg |
最后,两个多路复用器输出都将文件保存到磁盘。
我应该在管道中添加什么才能在任何媒体播放器上实现位置跟踪。
Regards
确保当您中断流时,gstreamer 正确地向所有元素发出流即将结束的信号。
通常这是通过发送 EOS 事件来完成的。
man gst-launch
[...]
-e, --eos-on-shutdown
Force an EOS event on sources before shutting the pipeline down.
This is useful to make sure muxers create readable files when a muxing
pipeline is shut down forcefully via Control-C.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)