Gstreamer视频输出位置跟踪和查找 [英] Gstreamer video output position tracking and seeking

查看:1369
本文介绍了Gstreamer视频输出位置跟踪和查找的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用gstreamer(gst-launch)捕获摄像机,并将流保存为视频和图像帧。流水线的问题是,当流水线完成(通过中断)视频记录时,它不能支持位置跟踪和搜索。因此,视频在具有未知长度的vlc播放器中播放。我认为问题是在管道本身。

I am using gstreamer (gst-launch) to capture camera and save the stream as both video and image frame. The problem of the pipeline is, when the pipeline finishes (by interrupt) the video record, it can not support position tracking and seeking. Hence, video is played in vlc player with unknown lenght. I think problem is at the pipeline itself. How can we achieve to support position tracking and seeking.

下面您可以看到gstreamer管道代码:

Here below you can see the gstreamer pipeline code:

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 &

管道的解释如下:

                                                        ______________  ________  _______     ________________
                                                        |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      |

在结束时,mux输出将文件保存到磁盘。
我应该添加到管道中以在任何媒体播放器上实现位置跟踪。

at the end both mux output saves files to disk. What should I add to the pipeline to achieve position tracking at any media player.

注意

推荐答案

确保gstreamer正确地指示流将要结束的所有元素,当您中断它。

make sure that gstreamer properly signals all the elements that the stream is about to end, when you interrupt it.

是通过发送EOS事件完成的。

usually this is done by sending an EOS event.

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.

这篇关于Gstreamer视频输出位置跟踪和查找的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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